mirror of
https://github.com/PlaneQuery/OpenAirframes.git
synced 2026-06-08 06:03:55 +02:00
fix None value comparision
This commit is contained in:
@@ -47,6 +47,9 @@ def convert_faa_master_txt_to_df(zip_path: Path, date: str):
|
|||||||
|
|
||||||
# Convert all NaN to empty strings
|
# Convert all NaN to empty strings
|
||||||
df = df.fillna("")
|
df = df.fillna("")
|
||||||
|
# The FAA parser can produce the literal string "None" for missing values;
|
||||||
|
# replace those so they match the empty-string convention used everywhere else.
|
||||||
|
df = df.replace("None", "")
|
||||||
|
|
||||||
return df
|
return df
|
||||||
|
|
||||||
@@ -84,8 +87,8 @@ def concat_faa_historical_df(df_base, df_new):
|
|||||||
# Convert to string
|
# Convert to string
|
||||||
val_str = str(val).strip()
|
val_str = str(val).strip()
|
||||||
|
|
||||||
# Handle empty strings
|
# Handle empty strings and null-like literals
|
||||||
if val_str == "" or val_str == "nan":
|
if val_str == "" or val_str == "nan" or val_str == "None":
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
# Check if it looks like a list representation (starts with [ )
|
# Check if it looks like a list representation (starts with [ )
|
||||||
|
|||||||
Reference in New Issue
Block a user