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 unit_test can't compile due to a Geometry-typed column #225

Open
MattTriano opened this issue Dec 18, 2024 · 1 comment
Open

dbt unit_test can't compile due to a Geometry-typed column #225

MattTriano opened this issue Dec 18, 2024 · 1 comment

Comments

@MattTriano
Copy link
Owner

I implemented a unit_test to cover my standard data_raw-stage logic, but I run into this issue that seems, at present, unresolvable.

00:46:57    Runtime Error in unit_test store_all_distinct_record_versions_chicago_crimes (models/data_raw/test_distinct_record_retention_logic.yml)
  An error occurred during execution of unit test 'store_all_distinct_record_versions_chicago_crimes'. There may be an error in the unit test definition: check the data types.
   Database Error
    syntax error at or near "USER"
    LINE 37:  as primary_type, cast(null as USER-DEFINED) as geometry, 

I tried adding in the offending column (named geometry)

geometry: ST_GeomFromText('POINT(0 0)')

but then the compiled sql in dbt/target/compiled/my_project/data_raw/test_distinct_record_retention_logic.yml shows the mocked up source() models still try to cast strings as USER-DEFINED, and I get the same error.

01:19:37    Runtime Error in unit_test store_all_distinct_record_versions_chicago_crimes (models/data_raw/test_distinct_record_retention_logic.yml)
  An error occurred during execution of unit test 'store_all_distinct_record_versions_chicago_crimes'. There may be an error in the unit test definition: check the data types.
   Database Error
    syntax error at or near "USER"
    LINE 39:     cast('ST_GeomFromText(''POINT(0 0)'')' as USER-DEFINED)

It's an open issue. I'll see if I can sort it and submit a PR.

@MattTriano
Copy link
Owner Author

ToDo: try using the SQL data mocking format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant