Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Alembic support #183

Merged
merged 8 commits into from May 25, 2021
Merged

feat: Alembic support #183

merged 8 commits into from May 25, 2021

Conversation

jimfulton
Copy link
Contributor

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:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #65 馃

The fixtures that we were autousing needed to be used explicitly, to
get randomly-generated dataset names.  One was only used for one test.

Also, fixed copyright.
We don't require alembic and most tests should run without it, however

- We run some unit tests (Python 3.8) to cover the alembic
  registration that happens when alembic is installed.

- We have a system test that demonstrates working with alembic and
  proves that the things we think should work do work. :)
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. label May 24, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label May 24, 2021
@jimfulton jimfulton marked this pull request as ready for review May 25, 2021 13:05
@jimfulton jimfulton requested a review from a team as a code owner May 25, 2021 13:05
Copy link

@shollyman shollyman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. It definitely highlights we have some future opportunities to better target our bleeding and trailing edges of supported python versions with some custom testing.

"""
)

# The only thing we can alter about a column is we can make it

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will change, but we're not currently watching the changes for the DDL params closely. Will need to figure out how to notify on changes like this. https://cloud.google.com/bigquery/docs/release-notes is how the team signals these changes for syntax historically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah! They just added table rename the other day.

except ImportError:
pass
else:
from alembic.ddl import impl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW you could appease flake8 by just importing impl above, rather than the bare import alembic.

@jimfulton jimfulton merged commit 4d5a17c into master May 25, 2021
@jimfulton jimfulton deleted the riversnake-alembic branch May 25, 2021 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alembic support
3 participants