googleapis / python-bigquery-sqlalchemy

SQLAlchemy dialect for BigQuery
MIT License
426 stars 127 forks source link

fix: Fix metadata reflection without a default dataset #1089

Open JacobHayes opened 2 months ago

JacobHayes commented 2 months ago

Fixes #838 and fixes #1088. 🦕

The get_table_names and get_view_names methods are supposed to return the bare names (no {schema}. prefix) of the resources for a single schema/dataset (where schema=None is the "default schema", not "all schemas"). However, the BigQueryDialect implementation returns:

The bolded parts cause issues outlined in #1088. This PR fixes the get_table_names and get_view_names implementations to return bare names as SQLAlchemy expects.

This is a breaking change for a subset of users:

This has been working for me locally with alembic + no default dataset (the models specify the schema) + include_schemas=True (required for cross-schema stuff).


conventional-commit-lint-gcf[bot] commented 2 months ago

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot https://conventionalcommits.org/

JacobHayes commented 1 month ago

Hi, any chance I could get the tests approved to run on the PR? I've been trying to setup the system tests locally, but they're a bit onerous (understandably).

Linchin commented 1 month ago

Sorry for the delay, just started running the tests!

JacobHayes commented 1 month ago

Sorry for the delay, just started running the tests!

no worries, thank you!