We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 85a17ed + cf492e4 commit 42bca7aCopy full SHA for 42bca7a
helpers.py
@@ -629,10 +629,9 @@ def tsv_to_json_pandas(tsv_string, project_id):
629
# Ensure string type, replace NaN with empty string
630
df[column] = df[column].fillna('')
631
632
- # IMPROVEMENT 7: Convert to list of dicts efficiently
633
- # pandas to_dict is much faster than manual iteration
+ # Replace all NaN with None so JSON is valid for Postgres
+ df = df.where(pd.notnull(df), None)
634
json_list = df.to_dict('records')
635
-
636
return json_list
637
638
0 commit comments