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

Support SQLAlchemy 2.0.x #938

Merged
merged 50 commits into from Feb 15, 2024
Merged

Support SQLAlchemy 2.0.x #938

merged 50 commits into from Feb 15, 2024

Conversation

Ahmad-Wahid
Copy link
Contributor

@Ahmad-Wahid Ahmad-Wahid commented Dec 19, 2023

Description

This PR updates SQLAlchemy dependency from version 1.4 to 2.0. The update underwent thorough testing to ensure compatibility, and all the tests passed successfully.

How to test

Run make install-for-dev to install the required packages. Do the testing using the UI and CLI.

Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
@Ahmad-Wahid Ahmad-Wahid linked an issue Dec 19, 2023 that may be closed by this pull request
Ahmad-Wahid and others added 14 commits December 20, 2023 17:58
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
…nto feature/update-sqlalchemy-2.0

# Conflicts:
#	requirements/3.10/app.txt
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
@nhoening
Copy link
Contributor

nhoening commented Feb 6, 2024

We can run the script @Nischay-Pro wrote to update the dependencies for all supported versions.

Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
@Flix6x Flix6x added this to the 0.19.0 milestone Feb 6, 2024
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
Copy link
Contributor

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

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

Please don't be scared by the high number of comments I made. Most of them are just duplicate suggestions to reduce the verbosity of the queries where possible (I was just keeping track of occurrences).

The code would probably also become cleaner if we refactor a bit, but probably that would be better as a follow-up PR.

I did find a couple of potentially serious issues with some of the delete statements (those that filter by name rather than by ID). Here we should take a critical look, but I believe the fixes should be easy.

All in all I think you did a great job on this PR. This looked like hard work. Some of these queries weren't trivial (e.g. in the migration files).

flexmeasures/ui/crud/users.py Outdated Show resolved Hide resolved
flexmeasures/api/dev/sensors.py Outdated Show resolved Hide resolved
flexmeasures/api/dev/tests/conftest.py Outdated Show resolved Hide resolved
flexmeasures/api/v3_0/assets.py Outdated Show resolved Hide resolved
flexmeasures/api/v3_0/assets.py Outdated Show resolved Hide resolved
flexmeasures/data/services/scheduling.py Outdated Show resolved Hide resolved
flexmeasures/data/services/users.py Outdated Show resolved Hide resolved
flexmeasures/data/tests/test_annotations.py Show resolved Hide resolved
flexmeasures/data/tests/test_annotations.py Show resolved Hide resolved
flexmeasures/data/tests/test_scheduling_repeated_jobs.py Outdated Show resolved Hide resolved
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
@Ahmad-Wahid
Copy link
Contributor Author

@Flix6x Some tests are failing, please fix them if you can. I have tried but couldn't understand them.

Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
Ahmad-Wahid and others added 3 commits February 15, 2024 09:08
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Flix6x and others added 4 commits February 15, 2024 11:16
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
…n IDs

Signed-off-by: F.N. Claessen <felix@seita.nl>
* style: fix typos

Signed-off-by: F.N. Claessen <felix@seita.nl>

* docs: add readme comment on updating requirements

Signed-off-by: F.N. Claessen <felix@seita.nl>

* chore: run ci/update-packages.sh

Signed-off-by: F.N. Claessen <felix@seita.nl>

---------

Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x merged commit 071a4de into main Feb 15, 2024
9 checks passed
@Flix6x Flix6x deleted the feature/update-sqlalchemy-2.0 branch February 15, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support SQLAlchemy 2
3 participants