-
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
Model contracts: raise warning for numeric types without specified scale #8721
Conversation
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 contributing guide. |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8721 +/- ##
=======================================
Coverage 86.65% 86.66%
=======================================
Files 176 176
Lines 25674 25765 +91
=======================================
+ Hits 22248 22329 +81
- Misses 3426 3436 +10
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.
just some nits otherwise LGTM
Co-authored-by: colin-rogers-dbt <[email protected]>
…ale (#8721) * add warning when contracting fields don't have precision * rename files * changelog * move tests out of adapter zone * Update core/dbt/include/global_project/macros/adapters/columns.sql Co-authored-by: colin-rogers-dbt <[email protected]> * Apply suggestions from code review --------- Co-authored-by: colin-rogers-dbt <[email protected]>
Opened a new issue in dbt-labs/docs.getdbt.com: dbt-labs/docs.getdbt.com#4251 |
…view) (#4258) closes #4251 Captures this Core change: dbt-labs/dbt-core#8721 This PR adds more context for rules, adds an example, and notes that core includes an error for 1.7 and higher. Note: This PR reverts #4257 which reverted #4255 --------- Co-authored-by: Emily Rockman <[email protected]>
resolves #8183
Problem
Enforces contracts with numeric types that don't specify scale run the risk of failing contract enforcement. This is actually confusing as they're not actually intentionally failing, the precision just needs to be specified so it can be enforced instead of applying the default.
Solution
If the user has provided a numeric data type, which should specify precision/scale, without having specified anything except the type, raise a warning.
Checklist