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

catch AttributeError instead of TypeError #526

Merged
merged 1 commit into from
Sep 12, 2023
Merged

catch AttributeError instead of TypeError #526

merged 1 commit into from
Sep 12, 2023

Conversation

davidism
Copy link
Contributor

@davidism davidism commented Sep 11, 2023

In Flask-SQLAlchemy 3.1, the deprecated get_engine method will be removed, after raising a DeprecationWarning in 3.0. 7cb4236 caught TypeError, but a method that doesn't exist raises an AttributeError.

@davidism
Copy link
Contributor Author

davidism commented Sep 11, 2023

I've kept get_engine for one more version in Flask-SQLAlchemy 3.1, so it will now be removed in 3.2, meaning the current env.py will not start failing yet. The old bind argument is accepted so users with the current env.py see the deprecation message. The message mentions Flask-Migrate (and Alembic) and tells users to update env.py, so hopefully this will make the transition a little smoother.

@miguelgrinberg miguelgrinberg merged commit f562178 into miguelgrinberg:main Sep 12, 2023
25 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.

2 participants