File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -232,7 +232,9 @@ def parse_stations_timeseries(S: "SynopticAPI") -> pl.DataFrame:
232232 )
233233
234234 # Cast 'date_time' column from string to datetime
235- observed = observed .with_columns (pl .col ("date_time" ).str .to_datetime ())
235+ observed = observed .with_columns (
236+ pl .col ("date_time" ).str .to_datetime (time_zone = "UTC" )
237+ )
236238
237239 # Parse the variable name
238240 observed = observed .pipe (parse_raw_variable_column )
@@ -365,7 +367,7 @@ def parse_stations_latest_nearesttime(S: "SynopticAPI") -> pl.DataFrame:
365367
366368 # Cast 'date_time' column from string to datetime
367369 observed = observed .with_columns (
368- pl .col ("date_time" ).str .to_datetime ("%Y-%m-%dT%H:%M:%S%#z " )
370+ pl .col ("date_time" ).str .to_datetime (time_zone = "UTC " )
369371 )
370372
371373 # Parse the variable name
@@ -411,7 +413,7 @@ def parse_stations_precipitation(S: "SynopticAPI") -> pl.DataFrame:
411413 .explode ("precipitation" )
412414 .unnest ("precipitation" )
413415 .with_columns (
414- pl .col ("first_report" , "last_report" ).str .to_datetime (),
416+ pl .col ("first_report" , "last_report" ).str .to_datetime (time_zone = "UTC" ),
415417 pl .lit (S .UNITS ["precipitation" ]).alias ("units" ),
416418 )
417419 )
You can’t perform that action at this time.
0 commit comments