diff --git a/digital_land/log.py b/digital_land/log.py index 67aef60e..8abeeb94 100644 --- a/digital_land/log.py +++ b/digital_land/log.py @@ -165,7 +165,11 @@ def add_severity_column(self, severity_mapping_path=None, severity_mapping=None) self.fieldnames.append("severity") self.fieldnames.append("description") self.fieldnames.append("responsibility") - self.rows = merged_df.to_dict(orient="records") + # Switch Pandas NaN to None to avoid issues with JSON + self.rows = [ + {k: (None if pd.isna(v) else v) for k, v in row.items()} + for row in merged_df.to_dict(orient="records") + ] def appendErrorMessage(self, mapping_path): # Read the mapping from the JSON config file