sematic-ai / sematic

An open-source ML pipeline development platform
Other
975 stars 59 forks source link

Use Engine.begin() instead of Engine.connect() to ensure DML/DDL statements are committed in migration code #1129

Closed bcalvert-graft closed 2 months ago

bcalvert-graft commented 2 months ago

Description

One of the changes in SQLAlchemy from 1.4.X -> 2.X is that they've removed automatic commits for DDL/DML statements fed into Connections created from Engine.connect(). This leads to a few minor bugs in the DB migration code post 0.39.0 release (and the SQLAlchemy 2.X migration in #1127).

This PR

This PR fixes those bugs by using Connections created by Engine.begin() instead

Testing

$ bazel run sematic/db/tests:test_migrate