Transient bump to SQLAlchemy >=2.1 creates dependency trap: Missing 'psycopg' vs 'NOTIFY run_events, $1' syntax error
What's the issue?
SQLAlchemy transitive bump breaks PostgreSQL storage (psycopg ModuleNotFoundError / NOTIFY $1 error)
Summary
A transitive dependency bump of sqlalchemy (to 2.1.x / 2.0.x) introduces a catch-22 / "rock and a hard place" state when using dagster-postgres:
psycopg2failure: SQLAlchemy defaults to usingpsycopg(v3). Ifpsycopgis missing, Dagster fails on startup with:ModuleNotFoundError: No module named 'psycopg'psycopg(v3) failure: Installingpsycopgcauses Dagster's event log storage to fail on run monitoring with:sqlalchemy.exc.ProgrammingError: (psycopg.errors.SyntaxError) syntax error at or near "$1"[SQL: NOTIFY run_events, %(notify_id)s;]
Expected Behavior
Dagster should gracefully handle PostgreSQL storage without requiring manual driver overrides or breaking when transitive dependencies update SQLAlchemy.
Workaround
Pin sqlalchemy==2.0.54
What did you expect to happen?
No response
How to reproduce?
No response
Dagster version
1.13.0
Deployment type
Docker Compose
Deployment details
No response
Additional information
No response
Message from the maintainers
Impacted by this issue? Give it a ! We factor engagement into prioritization.
Source: dagster-io/dagster