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 66b466e + 5374546 commit ddb7b15Copy full SHA for ddb7b15
helpers.py
@@ -580,11 +580,12 @@ def tsv_to_json_pandas(tsv_string, project_id):
580
581
# Handle strings
582
elif field_type == "string":
583
- df[column] = df[column].apply(lambda x: x if x is not None else "")
+ # For string fields, always use empty string for missing/None/NaN
584
+ df[column] = df[column].apply(lambda x: x if (x is not None and not (isinstance(x, float) and pd.isna(x))) else "")
585
586
# Other types: leave as is
587
- # Replace all NaN with None for JSON compatibility
588
+ # For non-string fields, ensure NaN is replaced with None
589
import math
590
def clean_nans(obj):
591
if isinstance(obj, float) and math.isnan(obj):
0 commit comments