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

Use branch 8007-contract_type_aliasing #954

Merged
merged 7 commits into from
Oct 10, 2023
Merged

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Oct 5, 2023

resolves #953

Problem

Need to match changes in dbt-labs/dbt-core#8592

Solution

Fix the test. Add TEXT => STRING conversion to TYPE_LABELS.

Checklist

  • I have read the contributing guide and understand what's expected of me
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc) or this PR has already received feedback and approval from Product or DX

@gshank gshank requested a review from a team as a code owner October 5, 2023 14:26
@gshank gshank requested a review from nathaniel-may October 5, 2023 14:26
@cla-bot cla-bot bot added the cla:yes label Oct 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-bigquery contributing guide.

@@ -13,12 +13,9 @@
@dataclass(init=False)
class BigQueryColumn(Column):
TYPE_LABELS = {
"STRING": "STRING",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we just be adding TEXT? Why delete the other types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no point to types that are the same on both sides. They do nothing except (in some cases) change the type from lowercase to uppercase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed them in the dbt-core PR because they were causing unnecessary churning in the test cases.

@gshank
Copy link
Contributor Author

gshank commented Oct 5, 2023

The test is currently failing because in test_constraints.py the "integer" type is being translated to "int64". It looks like the tests were working before with "integer". Is that conversion not necessary?

@gshank gshank merged commit 5396aa0 into main Oct 10, 2023
24 checks passed
@gshank gshank deleted the adap-953-contract_type_alising branch October 10, 2023 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ADAP-935] Support dbt-core 8592 type aliasing in model contracts
2 participants