-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Upgrade SQLAlchemy to version 2 #415
base: master
Are you sure you want to change the base?
Conversation
exists is a method, so prior to change, assert would always pass thankfully, this still works on sqlalchemy 1.4 after change
seems that table.table.exists() actually created table if we replace it with self.db_has_table instead, it doesn't work I assume because it works on sqlalchemy metadata level and not issuing actual sql engine commands to demonstrate that I've put the asserts with self.db.has_table in setUp method for now just removed the assert from test_create_table_shorthand* tests
passes all tests on sqlalchemy 1.4
all tests passed
It will also need a bump in |
|
||
- uses: mxschmitt/action-tmate@v3 | ||
|
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.
looks like you accidentally left a debugging step in github actions?
Howdy. We are using a library that depends on dataset and would like to see what specifically is preventing this pull request and how we can help git it where it needs to be. Is this pull request adequate or what is holding it back? |
Ok, so I've played with this a little bit on #420, and the problem is that this will only work on SQLite, not any DB with proper transactions management. SQLAlchemy has fundamentally gotten rid of autocommit mode, which was underpinning |
The more I dig into this the less certain I am that we're not due a massive re-work of the library in order to harmonize transaction handling and how it intersects with DDL commands. At the moment, the tests are producing a bunch of deadlocks when running against PostgreSQL. Does anyone here really understand transactions, and how they relate to schema modification? |
I think the default should be autocommit, as that's what (IMHO) one would generally expect from a library like dataset. For the case where full transaction control and speed (and possibly explicit control over DDL) is a driving critiera, I suggest sqlalchemy native is a better choice. |
I added my thoughts , hope it helps (I don't know the library well so I may be wrong). Afaik DDL commands cannot be executed inside another transaction, at least that's what the alembic docs on autocommit_block() seem to imply:
|
All unit tests passed