-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[WIP] Disable cascade_backrefs (prep for SQLAlchemy 2.0) #13164
[WIP] Disable cascade_backrefs (prep for SQLAlchemy 2.0) #13164
Conversation
Why we are using a separate registry and not the one containing all models: see inline comment in parent View class) lib/galaxy/model/view/__init__.py:70 /home/sergey/0dev/galaxy/_galaxy/dev/lib/galaxy/model/view/__init__.py:70: RemovedIn20Warning: Calling the mapper() function directly outside of a declarative registry is deprecated. Please use the sqlalchemy.orm.registry.map_imperatively() function for a classical mapping. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) mapper(HistoryDatasetCollectionJobStateSummary, HistoryDatasetCollectionJobStateSummary.__table__)
lib/galaxy/model/__init__.py:8937 /home/sergey/0dev/galaxy/_galaxy/dev/lib/galaxy/model/__init__.py:8937: RemovedIn20Warning: The legacy calling style of select() is deprecated and will be removed in SQLAlchemy 2.0. Please use the new calling style described at select(). (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) exists([HistoryDatasetCollectionAssociation.id], and_( lib/galaxy/model/__init__.py:8945 /home/sergey/0dev/galaxy/_galaxy/dev/lib/galaxy/model/__init__.py:8945: RemovedIn20Warning: The legacy calling style of select() is deprecated and will be removed in SQLAlchemy 2.0. Please use the new calling style described at select(). (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) exists([HistoryDatasetAssociation], and_( Ref: https://docs.sqlalchemy.org/en/14/errors.html#select-construct-created-in-legacy-mode-keyword-arguments-etc
test/unit/data/model/test_mapping.py::TestCleanupEvent::test_table /home/sergey/0dev/galaxy/_galaxy/dev/lib/galaxy/model/view/utils.py:80: RemovedIn20Warning: The Engine.execute() method is considered legacy as of the 1.x series of SQLAlchemy and will be removed in 2.0. All statement execution in SQLAlchemy 2.0 is performed by the Connection.execute() method of Connection, or in the ORM by the Session.execute() method of Session. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) engine.execute(CreateView(view.name, view.__view__)) https://docs.sqlalchemy.org/en/14/changelog/migration_20.html#execute-method-more-strict-execution-options-are-more-prominent
test/unit/data/model/test_mapping.py: 12 warnings /home/sergey/0dev/galaxy/_galaxy/dev/lib/galaxy/model/migrate/versions/util.py:204: RemovedIn20Warning: The current statement is being autocommitted using implicit autocommit, which will be removed in SQLAlchemy 2.0. Use the .begin() method of Engine or Connection in order to use an explicit transaction for DML and DDL statements. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) connection.execute(cmd)
RemovedIn20Warning: Using strings to indicate relationship names in Query.join() is deprecated and will be removed in SQLAlchemy 2.0. Please use the class-bound attribute directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid that for a lot of these we don't have great test coverage (that also asserts whatever modification was made actually got persisted). Can we add a config flag that turns on
When 2.0 deprecation warnings are enabled,
so we can collect some data on this on usegalaxy.org ?
I think that's a good idea. Then we could use the following sequence for addressing this:
Because, now that I think of it, we don't want to silence the warnings before fixing the underlying cause. Obviously...
|
Closing this, since we've decided not to silence the warnings, at least not until we've addressed each cause. |
Ref #12541 (comment)
How to test the changes?
(Select all options that apply)
License