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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbt run fails if there are external BigQuery tables in same dataset #791

Closed
improbable-benfischer opened this issue Jun 12, 2018 · 2 comments
Assignees
Labels
bigquery bug Something isn't working

Comments

@improbable-benfischer
Copy link

Besides views and tables, BigQuery also supports tables of external type. When dbt materializes a model of a dataset (schema) that has external tables, it fails with

Invalid arguments passed to "BigQueryRelation" instance: property "type", 'external' is not one of ['table', 'view', 'cte', None]

Steps to reproduce

  1. In a BigQuery project, create an external table foo.external_table (for example, use "Google Drive" as location and "Google Sheets" as file format).
  2. Create a dbt project for this BigQuery project. Use foo as default schema.
  3. Add a model models/foo/dbt_table.sql with any query, say SELECT 1 as bar.
  4. Run
dbt run --models foo.dbt_table

Log message

Found 0 analyses, 56 macros, 0 tests, 55 models, 0 operations, 0 seed files, 0 archives

16:16:20 | Concurrency: 8 threads (target='development')
16:16:20 | 
16:16:20 | 1 of 1 START table model foo.dbt_table............................... [RUN]
16:16:21 | 1 of 1 ERROR creating table model foo.dbt_table...................... [ERROR in 0.72s]
16:16:21 | 
16:16:21 | Finished running 1 table models in 2.06s.

Completed with 1 errors:

Runtime Error in model dbt_table (models/foo/dbt_table.sql)
  Invalid arguments passed to "BigQueryRelation" instance: property "type", 'external' is not one of ['table', 'view', 'cte', None]

Done. PASS=0 ERROR=1 SKIP=0 TOTAL=1

Workaround

If there are no external tables in dataset foo, this works. So, moving foo.external_table to baz.external_table resolves the issue.

@drewbanin drewbanin added the bug Something isn't working label Jun 12, 2018
@drewbanin drewbanin added this to the Betsy Ross (unreleased) milestone Jun 12, 2018
@drewbanin
Copy link
Contributor

Thanks @improbable-benfischer, we'll take a look

@drewbanin
Copy link
Contributor

Fixed in #828, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bigquery bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants