You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's some sort of agate-internal issue with converting array type columns to an Agate dataframe from a Postgres response. TBD what the exact culprit is, but it manifests as tuple.index(x): x not in tuple called via agate_table.table_from_data (specifically in table.select(column_names)). There's a solid reproduction case attached below.
Steps To Reproduce
Run the query:
select ARRAY[10000, 10000, 10000, 10000]
against a running rpc server. Poll for a response and see the error:
Traceback (most recent call last):
File \"/Users/drew/fishtown/dbt/core/dbt/node_runners.py\", line 227, in safe_run
result = self.compile_and_execute(manifest, ctx)
File \"/Users/drew/fishtown/dbt/core/dbt/node_runners.py\", line 170, in compile_and_execute
result = self.run(ctx.node, manifest)
File \"/Users/drew/fishtown/dbt/core/dbt/node_runners.py\", line 272, in run
return self.execute(compiled_node, manifest)
File \"/Users/drew/fishtown/dbt/core/dbt/rpc/node_runners.py\", line 86, in execute
compiled_node.injected_sql, fetch=True
File \"/Users/drew/fishtown/dbt/core/dbt/adapters/base/impl.py\", line 227, in execute
fetch=fetch
File \"/Users/drew/fishtown/dbt/core/dbt/adapters/sql/connections.py\", line 119, in execute
table = self.get_result_from_cursor(cursor)
File \"/Users/drew/fishtown/dbt/core/dbt/adapters/sql/connections.py\", line 110, in get_result_from_cursor
return dbt.clients.agate_helper.table_from_data(data, column_names)
File \"/Users/drew/fishtown/dbt/core/dbt/clients/agate_helper.py\", line 84, in table_from_data
return table.select(column_names)
File \"/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/agate/table/select.py\", line 21, in select
indexes = tuple(self._column_names.index(k) for k in key)
File \"/Users/drew/fishtown/dbt/env/lib/python3.7/site-packages/agate/table/select.py\", line 21, in <genexpr>
indexes = tuple(self._column_names.index(k) for k in key)
ValueError: tuple.index(x): x not in tuple
Expected behavior
I'd expect this query to return data successfully. The Array field should be json-ified, as with non-primitive types on other datbases (BQ, Snowflake).
System information
Which database are you using dbt with?
postgres
The output of dbt --version:
0.16.0
The text was updated successfully, but these errors were encountered:
Describe the bug
There's some sort of agate-internal issue with converting array type columns to an Agate dataframe from a Postgres response. TBD what the exact culprit is, but it manifests as
tuple.index(x): x not in tuple
called viaagate_table.table_from_data
(specifically intable.select(column_names)
). There's a solid reproduction case attached below.Steps To Reproduce
Run the query:
against a running rpc server. Poll for a response and see the error:
Expected behavior
I'd expect this query to return data successfully. The Array field should be json-ified, as with non-primitive types on other datbases (BQ, Snowflake).
System information
Which database are you using dbt with?
The output of
dbt --version
:The text was updated successfully, but these errors were encountered: