Skip to content

Dateparsing replacement in v3.4 is not 100% compatible #1580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Yelinz opened this issue Oct 22, 2024 · 2 comments
Closed

Dateparsing replacement in v3.4 is not 100% compatible #1580

Yelinz opened this issue Oct 22, 2024 · 2 comments
Labels

Comments

@Yelinz
Copy link

Yelinz commented Oct 22, 2024

Datetime parsing breaks for certain formats on some python versions.

Python 3.10 fromisoformat accepted strings https://docs.python.org/3.10/library/datetime.html#datetime.datetime.fromisoformat

datetime.fromisoformat('2011-11-04')
datetime.fromisoformat('2011-11-04T00:05:23')
datetime.fromisoformat('2011-11-04 00:05:23.283')
datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')
datetime.fromisoformat('2011-11-04T00:05:23+04:00')   

Python 3.11 fromisoformat accepted strings https://docs.python.org/3.11/library/datetime.html#datetime.datetime.fromisoformat

datetime.fromisoformat('2011-11-04')
datetime.fromisoformat('20111104')
datetime.fromisoformat('2011-11-04T00:05:23')
datetime.fromisoformat('2011-11-04T00:05:23Z')
datetime.fromisoformat('20111104T000523')
datetime.fromisoformat('2011-W01-2T00:05:23.283')
datetime.fromisoformat('2011-11-04 00:05:23.283')
datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')
datetime.fromisoformat('2011-11-04T00:05:23+04:00')   

We ran into the issue by using Z for UTC timezone in the datetime strings (2011-11-04T00:05:23Z) with python 3.10. Where as before 3.4 it still worked with the same input.

Bug introduced by 17d09c8

@erikwrede
Copy link
Member

erikwrede commented Oct 22, 2024

Hey @Yelinz,
thanks for the report. This one slipped through our tests and other checks. Sorry bout that. Will work on a fix& release for it this week.

@erikwrede
Copy link
Member

Fixed in 3.4.1 🙂

czosel pushed a commit to inosca/ebau that referenced this issue Nov 29, 2024
Graphene 3.4.1 fixes an important bug regarding dealing with
datetimes in UTC, with the `Z` suffix/tz marker.

Note that the next Caluma version (not yet released as of now) will
also have this dependency pinned, but I'd like to have this fix
to ensure no stray frontend bit will trigger the bug

(graphql-python/graphene#1580)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants