-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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-2343] [Bug] snapshot with custom datatypes breaks when source table is regenerated #7459
[CT-2343] [Bug] snapshot with custom datatypes breaks when source table is regenerated #7459
Conversation
closing and reopening to try and trigger tests |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7459 +/- ##
=======================================
Coverage ? 83.17%
=======================================
Files ? 174
Lines ? 25587
Branches ? 0
=======================================
Hits ? 21282
Misses ? 4305
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benorourke Thank you for implementing this fix. It looks like this is coming along fantastic. I think the only thing blocking this would be to possibly build out a small functional test styled after the examples mentioned in #7248
I would suggest creating the test file in the tests/functional
zone as it is postgres specific.
if there is anything I can do to help out please feel free to reach out.
Good call @McKnight-42 🧠 If we merge this without adding a functional test, then it could easily be un-done by a different PR like #9433. So we'll definitely want a functional test before merging this. Here's manual test that I did: dbt-labs/dbt-postgres#13 -- not sure how hard it would be to convert it to a functional test. |
Thanks for taking the time to open this PR @benorourke! Since opening, we've decoupled dbt Adapters from dbt Core, and this code now lives in a separate repo: dbt-postgres. A consequence of the decoupling is that PR can't be merged anymore as is, so we're closing it. For more context see #9171. The linked issue has already been transferred. Please don't hesitate to re-open your proposed code changes within this PR in the dbt-postgres repo. |
Resolves dbt-labs/dbt-postgres#13
Important
The contents of this PR should be compared with #9433 since they both touch on the same code and could easily overwrite each other. Ideally, both of them will functional tests so that one doesn't undo the other by accident.
Description
The macro postgres__get_columns_in_relation, which is called when the snapshot checks for any column changes, selects data_type from the information_schema. For any UDT this will return USER-DEFINED. We can instead conditionally select udt_name to get the name of the enum.
This pull request modifies the macro postgres__get_columns_in_relation to resolve udt names along with their schema, resulting in a successful snapshot build for source tables containing a UDT.
Checklist
changie new
to create a changelog entry