Closed epgui closed 1 year ago
I just faced this error! I'll submit a PR ASAP
Thank you for reporting this @epgui and for raising a PR @gmontanola 🙌
Just wanted to note that I just ran into this exact error - "Unhandled error while executing" for enforcing a model contract with uuid columns. Example yaml:
columns:
- name: payment_batch_id
data_type: uuid
description: ""
I also ran into this issue with the money
datatype, which is not mentioned in this issue or the PR addressing it (I think)
This PR is important as it solves an error with the snowplow_web package.
With the current adapter, you will receive a 2950 Runtime Error.
Can confirm that this PR resolves the problem.
@dbeatty10 do you know when the PR for this is likely to be merged please? This is an open issue for us and I'd prefer not to have to alter all our packages to put a workaround in for this.
For the record we don't currently use contracts or even specify the column type in the table that is erroring, but just having a uuid
type column causes this error.
EDIT:
We're getting the issue from the get_column_schema_from_query
macro, without having to enforce contracts at all.
@rlh1994 Thanks for opening https://github.com/dbt-labs/dbt-core/issues/8877! It does a nice job of explaining the general case of unknown data types and laying out options. Since it is more broad in impact, we are likely to prioritize https://github.com/dbt-labs/dbt-core/issues/8877 over https://github.com/dbt-labs/dbt-postgres/issues/54. Not to say that both can't be done, just that we'd likely approach them in that order.
Is this a new bug in dbt-core?
Current Behavior
I have a source table with the following DDL, populated with three records:
I have created the following staging model:
I have configured it this way:
When I run DBT, I get the following error, with no extra context and no other information:
It looks like
2950
is theoid
of the UUID data type in postgres: https://github.com/postgres/postgres/blob/5e0c761d0a13c7b4f7c5de618ac38560d74d74d0/src/include/catalog/pg_type.dat#L403If I cast all my UUIDs to TEXT, and change my contracts to TEXT instead of UUID, the error disappears. Without the contracts, the model runs just fine and the UUID type works as expected.
Expected Behavior
See previous section
Steps To Reproduce
See previous section
Relevant log output
No further context or any other information is output with this error. It looks like
2950
is theoid
of the UUID data type in postgres: https://github.com/postgres/postgres/blob/5e0c761d0a13c7b4f7c5de618ac38560d74d74d0/src/include/catalog/pg_type.dat#L403Environment
Which database adapter are you using with dbt?
postgres
Additional Context
No response