Skip to content

Conversation

@YuriZmytrakov
Copy link
Collaborator

@YuriZmytrakov YuriZmytrakov commented Nov 24, 2025

Description:

Currently, the min and max dates used in apply_datetime_filter for POST requests are not formatted correctly. This PR fixes the issue:

{"code":"ParserError","description":"Unknown string format: 2262-04-11T23:47:16.854775+00:00Z"}

PR Checklist:

  • Code is formatted and linted (run pre-commit run --all-files)
  • Tests pass (run make test)
  • Documentation has been updated to reflect changes, if applicable
  • Changes are added to the changelog

Copy link
Collaborator

@jonhealy1 jonhealy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should line 78 look like this for consistency?

datetime_iso = dt_utc.isoformat().replace("+00:00", "Z")

# Ensure datetimes are converted to UTC and formatted with 'Z'
if start:
result["gte"] = start.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"
result["gte"] = start_utc.isoformat().replace("+00:00", "Z")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be start.isoformat() not start_utc.isoformat() I think

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thank you!

result["gte"] = start_utc.isoformat().replace("+00:00", "Z")
if end:
result["lte"] = end.strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"
result["lte"] = end_utc.isoformat().replace("+00:00", "Z")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here - end_utc has not been defined in this block

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thank you!

@YuriZmytrakov
Copy link
Collaborator Author

Should line 78 look like this for consistency?

datetime_iso = dt_utc.isoformat().replace("+00:00", "Z")

Yes, thank you, fixed this too.

Copy link
Collaborator

@jonhealy1 jonhealy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work

@YuriZmytrakov YuriZmytrakov merged commit 8cbd482 into main Dec 2, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants