Skip to content
Snippets Groups Projects
Verified Commit c7b108bd authored by Daniel Hornung's avatar Daniel Hornung
Browse files

MAINT: Put all dtype checks into one condition.

parent 2b5587f5
No related branches found
No related tags found
2 merge requests!89ENH: JsonSchemaExporter accepts do_not_create parameter.,!77F fix strict values in table columns
......@@ -338,11 +338,11 @@ class TableImporter():
# float, because CaosDB does not have different sizes anyway.
col_dtype = df.dtypes[key]
if not strict and not np.issubdtype(col_dtype, datatype):
issub = np.issubdtype
# These special cases should be fine.
if issub(col_dtype, np.integer) and issub(datatype, np.floating):
df[key] = df[key].astype(datatype)
elif datatype == str:
if ((datatype == str)
or (np.issubdtype(col_dtype, np.integer)
and np.issubdtype(datatype, np.floating))
):
df[key] = df[key].astype(datatype)
# Now check each element
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment