Skip to content

fix(bigquery): preserve parsed database in create_view return path#11988

Open
RedZapdos123 wants to merge 1 commit intoibis-project:mainfrom
RedZapdos123:fix/bigquery-create-view-database-11974
Open

fix(bigquery): preserve parsed database in create_view return path#11988
RedZapdos123 wants to merge 1 commit intoibis-project:mainfrom
RedZapdos123:fix/bigquery-create-view-database-11974

Conversation

@RedZapdos123
Copy link
Copy Markdown

@RedZapdos123 RedZapdos123 commented Apr 4, 2026

This PR fixes BigQuery create_view with database values in project.dataset format as reported in #11974.

The issue is in the create_view return path: create_view parses the database into catalog/db for SQL generation, but then returns self.table(...) using the original database string. For inputs like my-project.my_dataset this reconstructs as my-project.my-project.my_dataset and then raises a ValueError.

This change keeps the parsed database tuple (catalog, db) when returning the created view expression.

It also adds a targeted unit regression test that exercises create_view with project.dataset input and asserts that the returned table lookup uses the parsed tuple.

Tested:

  • pytest ibis/backends/bigquery/tests/unit/test_client.py -q

The screenshot of the tests for validation (run on WSL):

image

Fixes #11974

Fixes ibis-project#11974

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@github-actions github-actions bot added tests Issues or PRs related to tests bigquery The BigQuery backend labels Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bigquery The BigQuery backend tests Issues or PRs related to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: BigQuery backend create_view doesn't handle project in database arg

2 participants