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

Pin flask < 3.x for flask sqlalchemy tests #412

Merged
merged 1 commit into from
Oct 23, 2023
Merged

Conversation

srprash
Copy link
Contributor

@srprash srprash commented Oct 19, 2023

Issue:
Flask SqlAlchemy under the hood tries to import '_app_ctx_stack' from Flask but this has been removed in the new flask v3.0.0: pallets/flask#5223

Description of changes:
Pinning the flask dependency major version to prevent breaking the unit tests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@srprash srprash marked this pull request as ready for review October 19, 2023 22:29
@srprash srprash requested a review from a team as a code owner October 19, 2023 22:29
@atshaw43
Copy link
Contributor

Does this library only affect unit tests?
If not, would it be better to upgrade SqlAlchemy instead of pinning Flask?

@atshaw43
Copy link
Contributor

atshaw43 commented Oct 20, 2023

When did these tests start failing?
Seems odd that this kind of issue just pops up.

@srprash
Copy link
Contributor Author

srprash commented Oct 23, 2023

Does this library only affect unit tests?
If not, would it be better to upgrade SqlAlchemy instead of pinning Flask?

#359
We know that X-Ray SDK is not compatible for SqlAlchemy 3.x and thats why we had to pin it to 2.5.1.
Flask unit tests work fine for flask=3.0.0. But the problem is with SqlAlchemy 2.x as it is only compatible with Flask 2.x.

The long-term solution is to add support for instrumenting SqlAlchemy 3.x.

@srprash
Copy link
Contributor Author

srprash commented Oct 23, 2023

When did these tests start failing?
Seems odd that this kind of issue just pops up.

Flask just released a new major version with backwards incompatible changes that SqlAlchemy depended on. Since we pull in the latest version of Flask in our unit tests, this started breaking as soon as we pulled in Flask v3.0.0.

@srprash srprash merged commit c0550a5 into master Oct 23, 2023
10 checks passed
@srprash srprash deleted the srprash-patch-1 branch October 23, 2023 16:24
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