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

Upgrade SQLAlchemy #315

Merged
merged 1 commit into from
May 25, 2023
Merged

Upgrade SQLAlchemy #315

merged 1 commit into from
May 25, 2023

Conversation

sea-kelp
Copy link
Collaborator

Description of Changes

Upgrade SQLAlchemy (finally)! Most changes are adapted from lucyparsons@14bfc5b

Notes for Deployment

None!

Screenshots (if appropriate)

N/A

Tests and linting

  • I have rebased my changes on main

  • just lint passes

  • just test passes

@sea-kelp sea-kelp requested a review from a team as a code owner May 14, 2023 16:36
Comment on lines +125 to +127
Face.query.join(Officer, Face.officer_id == Officer.id)
.join(Department, Officer.department_id == Department.id)
.filter(Department.id != AC_DEPT)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +111 to 118
def test_filters_do_not_exclude_officers_without_assignments(mockdata, db):
department = OpenOversight.app.models.Department.query.first()
officer = OpenOversight.app.models.Officer(
first_name="Rachel", last_name="S", department=department, birth_year=1992
)
db.session.add(officer)
results = OpenOversight.app.utils.grab_officers({"name": "S", "dept": department})
assert officer in results.all()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk how this test has been passing 🤔

@@ -49,6 +49,7 @@ services:
environment:
ENVIRONMENT: development
FLASK_DEBUG: 1
SQLALCHEMY_WARN_20: 1
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turn on SQLAlchemy 2.x deprecation warnings

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

Copy link
Collaborator

@AetherUnbound AetherUnbound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for taking this on! I was able to build & test this locally and it worked great 🚀

@@ -49,6 +49,7 @@ services:
environment:
ENVIRONMENT: development
FLASK_DEBUG: 1
SQLALCHEMY_WARN_20: 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

@AetherUnbound AetherUnbound merged commit 72431c2 into main May 25, 2023
@AetherUnbound AetherUnbound deleted the chore/upgrade-sqlalchemy branch May 25, 2023 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants