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

[Bug] tuple.index(x): x not in tuple #1626

Closed
drewbanin opened this issue Jul 23, 2019 · 1 comment
Closed

[Bug] tuple.index(x): x not in tuple #1626

drewbanin opened this issue Jul 23, 2019 · 1 comment
Assignees
Labels
bigquery bug Something isn't working
Milestone

Comments

@drewbanin
Copy link
Contributor

Issue

Issue description

On BigQuery, calls to execute with fetch=True that return nested/repeated records fail with the error tuple.index(x): x not in tuple. This happens because Agate coerces a nested field like {"col": [1,2,3]} into a table like

col.0 col.1 col.2
1 2 3

When dbt tries to call table.select(columns) on the Agate table (in order to re-order the column as specified in the query, Agate raises an exception because select(['col']) is provided, but there is no such Column in the Agate table.

This code path occurs primarily in calls to the rpc server.

dbt version: >= 0.14.0

Possible Approaches:

  • don't try to reorder columns with select
  • flatten out the BQ table results before suppling them to Agate
  • stringify nested/repeated records (bad)
@drewbanin drewbanin added bug Something isn't working bigquery labels Jul 23, 2019
@drewbanin drewbanin added this to the 0.14.1 milestone Jul 23, 2019
@drewbanin drewbanin self-assigned this Jul 23, 2019
drewbanin added a commit that referenced this issue Jul 30, 2019
…rd-execute

(#1626) fix for RPC error with BQ nested fields
@drewbanin
Copy link
Contributor Author

fixed in #1638

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

1 participant