mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-27 03:14:33 +02:00
This commit is contained in:
parent
d0e25fbc0d
commit
570bee7edd
3 changed files with 90 additions and 125 deletions
|
|
@ -31,8 +31,11 @@ def suggest_column_types(records):
|
|||
for record in records:
|
||||
for key, value in record.items():
|
||||
all_column_types.setdefault(key, set()).add(type(value))
|
||||
column_types = {}
|
||||
return types_for_column_types(all_column_types)
|
||||
|
||||
|
||||
def types_for_column_types(all_column_types):
|
||||
column_types = {}
|
||||
for key, types in all_column_types.items():
|
||||
# Ignore null values if at least one other type present:
|
||||
if len(types) > 1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue