-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
1.5 transaction model did not expect branched connections #782
Comments
can you share your env.py please? im not able to locate it within the repo given |
it's ultimately https://github.com/dagster-io/dagster/blob/master/python_modules/dagster/dagster/core/storage/sql.py need to figure out what "Connection" is here |
no tox file, so yes can you please provide steps to run your test suite. Is there something special about the SQLAlchemy engine or connecvtion in use? there's an attribute missing and I am not able to reproduce that locally. |
Here's the env.py: Here's the tox file for the test suite in question: To reproduce with just one failing test from the root folder (in master, but from before we just landed an alembic pin as a temporary workaround): cd python_modules/dagster Will investigate if there's anything unique about our engine/connection that might be causing this. |
Updated repro steps (including a specific revision to checkout from before the pin): git checkout 89b27c7e0d9615356dedf45397a61ec1a7bf05aa |
ok thanks for the detailed info, this was straightforward. the bug is that Alembic's test suite is not expecting to have received a "branched" connection, so will fix that now. however "branched" connections are deprecated in 1.4 so you might want to move off of this pattern in any case. the patch below will resolve but this assumes "connection" for you is always a Connection and not an Engine: diff --git a/python_modules/dagster/dagster/core/storage/sql.py b/python_modules/dagster/dagster/core/storage/sql.py
index cf12888c5..2c3a7d9c5 100644
--- a/python_modules/dagster/dagster/core/storage/sql.py
+++ b/python_modules/dagster/dagster/core/storage/sql.py
@@ -124,8 +124,8 @@ def run_migrations_online(context, config, target_metadata):
"command line, STOP and read the README."
)
- with connectable.connect() as connection:
- context.configure(connection=connection, target_metadata=target_metadata)
+ connection = connectable
+ context.configure(connection=connection, target_metadata=target_metadata)
- with context.begin_transaction():
- context.run_migrations()
+ with context.begin_transaction():
+ context.run_migrations()
|
Mike Bayer has proposed a fix for this issue in the master branch: retrieve 1.3 transaction from branched connection properly https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/2489 |
Summary: Based on the suggestion here: sqlalchemy/alembic#782 (always pass in an engine, not just a connection) Also stop using a deprecated type param that was removed Test Plan: BK Reviewers: alangenfeld, prha, nate Reviewed By: alangenfeld Differential Revision: https://dagster.phacility.com/D6040
Describe the bug
Hello, after the recent alembic 1.5.0 release our alembic upgrades have started failing with a stack trace in SQLAlchemy code.
The bottom of the stack trace is:
We're currently on SQLAlchemy==1.3.22 (the latest non-beta release) Upgrading to SQLAlchemy=1.4.0b1 fixes the problem.
Expected behavior
Alembic upgrades succeed without needing to upgrade to a beta version of SQLAlchemy
To Reproduce
Check out the repo at https://github.com/dagster-io/dagster and run our automated test suite against master. Can provide more details/repro steps here if needed.
Error
Versions.
Have a nice day!
The text was updated successfully, but these errors were encountered: