convert number cols as string if this is in schema
This commit is contained in:
parent
fd6035aba0
commit
3efd530d18
|
@ -227,6 +227,8 @@ class ImportForm(forms.Form):
|
|||
df[col] = df[col].dt.strftime("%Y-%m-%d")
|
||||
|
||||
for col in df.select_dtypes(include=['number']).columns:
|
||||
sc_col = self.json_schema.get("properties", {}).get(col, {})
|
||||
if sc_col.get("type") == "string":
|
||||
df[col] = df[col].astype(str)
|
||||
|
||||
data_pd = df.fillna('').to_dict()
|
||||
|
|
Loading…
Reference in New Issue