File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -233,6 +233,14 @@ def combine_timeseries_results(results: List[Data]) -> Data:
233233 )
234234 combined_df ["date-time" ] = combined_df ["date-time" ].astype ("Int64" )
235235 combined_df = combined_df .reindex (columns = ["date-time" , "value" , "quality-code" ])
236+
237+ # Replace NaN in value column with None so they serialize as JSON null
238+ # rather than the invalid JSON literal NaN.
239+ combined_df ["value" ] = (
240+ combined_df ["value" ]
241+ .astype (object )
242+ .where (combined_df ["value" ].notna (), other = None )
243+ )
236244 # Update the "values" key in the JSON to include the combined data
237245 combined_json ["values" ] = combined_df .values .tolist ()
238246
Original file line number Diff line number Diff line change 22name = " cwms-python"
33repository = " https://github.com/HydrologicEngineeringCenter/cwms-python"
44
5- version = " 1.0.4 "
5+ version = " 1.0.6 "
66
77
88packages = [
You can’t perform that action at this time.
0 commit comments