Skip to content

Support SQLAlchemy 2.0.x - #938

Merged
Flix6x merged 50 commits into
mainfrom
feature/update-sqlalchemy-2.0
Feb 15, 2024
Merged

Support SQLAlchemy 2.0.x#938
Flix6x merged 50 commits into
mainfrom
feature/update-sqlalchemy-2.0

Conversation

@Ahmad-Wahid

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

Copy link
Copy Markdown
Contributor

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>
@nhoening

nhoening commented Feb 6, 2024

Copy link
Copy Markdown
Member

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
Comment thread flexmeasures/data/models/time_series.py Outdated
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
Comment thread flexmeasures/cli/data_delete.py Outdated
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
@Ahmad-Wahid
Ahmad-Wahid requested a review from Flix6x February 12, 2024 13:17

@Flix6x Flix6x left a comment

Copy link
Copy Markdown
Member

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).

Comment thread flexmeasures/ui/crud/users.py Outdated
Comment thread flexmeasures/api/dev/sensors.py Outdated
Comment thread flexmeasures/api/dev/tests/conftest.py Outdated
Comment thread flexmeasures/api/v3_0/assets.py Outdated
Comment thread flexmeasures/api/v3_0/assets.py Outdated
Comment thread flexmeasures/data/services/scheduling.py Outdated
Comment thread flexmeasures/data/services/users.py Outdated
Comment thread flexmeasures/data/tests/test_annotations.py
Comment thread flexmeasures/data/tests/test_annotations.py
Comment thread flexmeasures/data/tests/test_scheduling_repeated_jobs.py Outdated
Signed-off-by: Ahmad Wahid <ahmedwahid16101@gmail.com>
@Ahmad-Wahid

Copy link
Copy Markdown
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
Ahmad-Wahid requested a review from Flix6x February 14, 2024 18:13
Comment thread flexmeasures/data/services/users.py Outdated
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
@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