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

Address breaking change in Python 3.11 for Enums with str mixins #1885

Merged
merged 7 commits into from Dec 21, 2023

Conversation

alvanson
Copy link
Contributor

@alvanson alvanson commented Oct 9, 2023

Addresses breaking change in Python 3.11 for Enums with str mixins. See https://blog.pecar.me/python-enum for more information on the issue.

Retains compatibility with Python 3.8 by using the StrEnum PyPi package rather than the built-in StrEnum introduced in 3.11.

This came to my attention when switching from the MongoDB to the PostgreSQL backend under Python 3.11. The JOINs in get_alerts() now use the member's name (e.g. Severity.Minor) rather than its value (e.g. minor) resulting in no alerts showing in the Web UI. The requested changes fix this and likely other issues.

@andywow
Copy link

andywow commented Nov 13, 2023

Got the same behavior with python3.11 and Postgres

@satterly
Copy link
Member

Thanks! 👍

@satterly satterly merged commit bdce8d6 into alerta:master Dec 21, 2023
4 of 12 checks passed
@mirceaulinic
Copy link

mirceaulinic commented Mar 11, 2024

👋🏼 thanks @alvanson for this fix. I've been watching this for a while, @satterly is there any ETA for a new release that'll include these changes? Cheers!

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.

None yet

4 participants