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

Data types that are supported in model contracts and/or unit tests #6127

Open
1 task done
dbeatty10 opened this issue Sep 24, 2024 · 0 comments
Open
1 task done

Data types that are supported in model contracts and/or unit tests #6127

dbeatty10 opened this issue Sep 24, 2024 · 0 comments
Labels
content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear

Comments

@dbeatty10
Copy link
Contributor

Contributions

  • I have read the contribution docs, and understand what's expected of me.

Link to the page on docs.getdbt.com requiring updates

Maybe one of these places? 🤷

What part(s) of the page would you like to see updated?

From time-to-time, we get a question like this:

I'm using the FOO data type with BAR database, and I'm trying to add a model contract and/or unit tests. How come it isn't working?

Here's the super-specific nerd answer 🤓:

We support whichever data types meet these two criteria:

  1. the data type name naturally falls out of an information_schema.columns query (or equivalent), and
  2. cast(null as DATA_TYPE_NAME) works

For all the standard types in Postgres (int, varchar, date, etc, etc), both of the following hold. But it doesn't for the more exotic types (geometry, money, hstore, etc).

From what I can tell, we can actually overcome both in many scenarios. But it requires time and effort that could be difficult to prioritize.

But sometimes we are able to prioritize it. Like geography and geometry in Snowflake [1, 2, 3].

Additional information

No response

@dbeatty10 dbeatty10 added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear
Projects
None yet
Development

No branches or pull requests

1 participant