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
fix: ensure correct alter table alter column statement is generated on data type changes in alembic #845
fix: ensure correct alter table alter column statement is generated on data type changes in alembic #845
Conversation
@benvdh-incentro |
@chalmerlowe I have the details page available (though only on a desktop, not on my smartphone)... so I can see the system 3.8 test is failing with the following error: Traceback (most recent call last):
File "/tmpfs/src/github/python-bigquery-sqlalchemy/tests/system/test_alembic.py", line 55, in alembic_table
migration_context = alembic.migration.MigrationContext.configure(conn, {})
File "/tmpfs/src/github/python-bigquery-sqlalchemy/.nox/system-3-8/lib/python3.8/site-packages/alembic/runtime/migration.py", line 269, in configure
return MigrationContext(dialect, connection, opts, environment_context)
File "/tmpfs/src/github/python-bigquery-sqlalchemy/.nox/system-3-8/lib/python3.8/site-packages/alembic/runtime/migration.py", line 197, in __init__
self.impl = ddl.DefaultImpl.get_by_dialect(dialect)(
File "/tmpfs/src/github/python-bigquery-sqlalchemy/.nox/system-3-8/lib/python3.8/site-packages/alembic/ddl/impl.py", line 120, in get_by_dialect
return _impls[dialect.name]
KeyError: 'bigquery'
- generated xml file: /tmpfs/src/github/python-bigquery-sqlalchemy/system_3.8_sponge_log.xml - Yesterday I ran all the unit tests locally, but for the system tests, it seemed to hang locally (probably because it needed to connect to a real bigquery instance; or because it was running silently...). I can imagine it was because I moved some code around (that is specific to alembic), and the test was not updated accordingly... I can have a look tomorrow... |
@chalmerlowe it turns out the alembic system test indeed failed because I moved the code to a separate module. I added it back to I've also made an attempt to add an additional system test, that tests altering column types... Somehow I only got that part working with a column set to nullable. In case of columns that are not NULLABLE (or mode required) - as it is the case with the transactions table in the alembic system test - it failed with the following error:
I have tried playing around with the Perhaps you can have a look at this one, and re-run the CI? |
…c system test fail
a4fbbd2
to
60ce7e2
Compare
@chalmerlowe I got the coverage error as well locally, I am guessing it's because the ImportError in What are your thoughts on this? |
based on the results in coverage, the statement that is not tested appears to be the result of our function
This snippet:
I have not messed with coverage much, I am not sure how coverage goes about calculating "coverage" via test. I can poke around to see what I can find out, but won't be til later today or tomorrow, prolly. |
@benvdh-incentro thanks your time and effort on this. This should show up in the next release. |
@chalmerlowe thank you too for the last bit to get the code through the pipeline. It was my pleasure to help and learn a lot along the way. |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #471 🦕