-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[CT-1669] [Bug] type_timestamp()
returns incorrect value for Postgres and Snowflake
#6453
Comments
type_timestamp()
returns incorrect value for Postgres and Snowflaketype_timestamp()
returns incorrect value for Postgres and Snowflake
I realize the above matches the docs, however I'm not sure why the described behavior is useful or desired. |
@clausherther Thanks for reaching out about this! To make sure I'm following with you, does the following capture the difference between what you're actually seeing versus your expectations?
Assuming so, here's some more info: Migration of cross-database type_* macros from dbt-utils to dbt-coreI think that the last implementation of We tried to do some consolidation of data type logic in this PR (by taking advantage of Here's a chain of references explaining why
Next stepsI'm actually a bit surprised we haven't heard problems about this! I wonder if it's because We've got a few options:
I don't know what the consequences would be if we update the As next steps, we should try out each of the options above to determine the consequences of each. Heads-up: we all be out of the office until Jan 3rd, so my responses will be delayed until after that. |
@dbeatty10 thanks for the detailed reply! Let's chat more after the New Year. |
@clausherther I gave this some more thought, and I think we should implement Option 2 listed above:
Let me know what you think! Pros
Cons
Implementation hintsThe proposed implementation would involve coordinated PRs in 5 different repos: dbt-core, dbt-bigquery, dbt-redshift, dbt-snowflake, and dbt-spark. I were to implement this, here's how I might go about it:
dbt-bigquery is already has |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers. |
Is this a new bug in dbt-core?
Current Behavior
type_timestamp()
,This renders to
However,
for this column returns:
This makes testing data types using the built in types impossible.
For context, in dbt-expectations, we've had to override
type_timestamp()
for that reason and would like to deprecate that in favor of the dbt-core implementation.Expected Behavior
type_timestamp()
should return the native data type, e.g.TIMESTAMP WITHOUT TIME ZONE
In dbt-expectations, we use this right now:
Steps To Reproduce
See steps above. Tested on Postgres, BigQuery and Snowflake.
Relevant log output
No response
Environment
Which database adapter are you using with dbt?
postgres, snowflake, bigquery
Additional Context
No response
The text was updated successfully, but these errors were encountered: