Skip to content
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

Will mostly fail on Python 3.11 (string enums no longer literal strings) #169

Closed
SinaKhalili opened this issue Nov 29, 2022 · 4 comments · Fixed by #188
Closed

Will mostly fail on Python 3.11 (string enums no longer literal strings) #169

SinaKhalili opened this issue Nov 29, 2022 · 4 comments · Fixed by #188
Labels
bug Something isn't working

Comments

@SinaKhalili
Copy link

Bug report

Any filter (such as eq, lte, etc) will fail on Python 3.11

To observe this, install python 3.11 and run the existing test suit.

Describe the bug

The pattern for inheriting from (str, Enum) in order to get a literal string (used in types) no longer works in python 3.11.

Instead it's advised to inherit from the standard library's new StrEnum class.

For older versions a check can be done and use the StrEnum package for 3.6+ (not part of standard library).

Alternatively, one could use the .value of an enum and no longer inherit from str.

@SinaKhalili SinaKhalili added the bug Something isn't working label Nov 29, 2022
@SinaKhalili SinaKhalili changed the title Tests will fail on Python 3.11 (string enums no longer literal strings) Will mostly fail on Python 3.11 (string enums no longer literal strings) Nov 29, 2022
@SinaKhalili
Copy link
Author

I can open a PR if you'd like, let me know which approach works best.

@e-gons
Copy link

e-gons commented Dec 6, 2022

Not sure if this is related, but I get json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) on every successful request (get, upsert, delete, etc.) using Python 3.11.

@LindezaGrey
Copy link

For me it fails on "insert" because the parameter returning is set to ReturnMethod.representation. If i manually set it to "representation" it works.

@J0
Copy link
Contributor

J0 commented Jan 9, 2023

Hey @SinaKhalili,

Thanks for opening this issue and apologies for the delayed reply - if you still have the bandwidth feel free to open a PR which makes use of StrEnum but no worries if you're occupied. If you could add python3.11 to the CI while you're at it that would be fantastic as well.

Otherwise, we'll get to it when we have a free cycle.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants