mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 17:34:32 +02:00
Suggest column types ignores nulls, closes #94
This commit is contained in:
parent
755580e2f3
commit
1c745df923
2 changed files with 8 additions and 1 deletions
|
|
@ -13,7 +13,8 @@ def suggest_column_types(records):
|
|||
all_column_types = {}
|
||||
for record in records:
|
||||
for key, value in record.items():
|
||||
all_column_types.setdefault(key, set()).add(type(value))
|
||||
if value is not None:
|
||||
all_column_types.setdefault(key, set()).add(type(value))
|
||||
column_types = {}
|
||||
for key, types in all_column_types.items():
|
||||
if len(types) == 1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue