Skip to content

Commit 943f98b

Browse files
Correct syntax error
1 parent 66ecef7 commit 943f98b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/datapoint/Forecast.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,9 @@ def _build_timestep(self, forecast, parameters):
262262
# Need to parse format like 2024-02-17T15:00Z. This can only be
263263
# done with datetime.datetime.fromisoformat from python 3.11
264264
# onwards. Using this if statement to remember to remove the
265-
# explicit strptime in the future.
266-
timestep = datetime.datetime.strptime(
265+
# explicit strptime in the future, and it annoyed me that
266+
# fromisoformat couldn't handle all iso-formatted datetimes.
267+
timestep["time"] = datetime.datetime.strptime(
267268
forecast["time"], "%Y-%m-%dT%H:%M%z"
268269
)
269270
else:

0 commit comments

Comments
 (0)