-
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
Preserve decimal places for dbt show #8561
Merged
Merged
+125
−36
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* add show test for json data * oh changie my changie * revert unecessary cahnge to fixture * keep decimal class for precision methods, but return __int__ value * jerco updates * update integer type * update other tests * Update .changes/unreleased/Fixes-20230803-093502.yaml --------- Co-authored-by: Emily Rockman <emily.rockman@dbtlabs.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #8561 +/- ##
==========================================
- Coverage 86.41% 86.37% -0.05%
==========================================
Files 174 174
Lines 25587 25598 +11
==========================================
- Hits 22112 22110 -2
- Misses 3475 3488 +13
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
gshank
approved these changes
Sep 6, 2023
github-actions bot
pushed a commit
that referenced
this pull request
Sep 7, 2023
* update `Number` class to handle integer values (#8306) * add show test for json data * oh changie my changie * revert unecessary cahnge to fixture * keep decimal class for precision methods, but return __int__ value * jerco updates * update integer type * update other tests * Update .changes/unreleased/Fixes-20230803-093502.yaml --------- Co-authored-by: Emily Rockman <emily.rockman@dbtlabs.com> * account for integer vs number on table merges * add tests for combining number with integer. * add unit test when nulls are added * cant none as an Integer * fix null tests --------- Co-authored-by: dave-connors-3 <73915542+dave-connors-3@users.noreply.github.com> Co-authored-by: Dave Connors <dave.connors@fishtownanalytics.com> (cherry picked from commit be94bf1)
emmyoop
added a commit
that referenced
this pull request
Sep 7, 2023
* update `Number` class to handle integer values (#8306) * add show test for json data * oh changie my changie * revert unecessary cahnge to fixture * keep decimal class for precision methods, but return __int__ value * jerco updates * update integer type * update other tests * Update .changes/unreleased/Fixes-20230803-093502.yaml --------- Co-authored-by: Emily Rockman <emily.rockman@dbtlabs.com> * account for integer vs number on table merges * add tests for combining number with integer. * add unit test when nulls are added * cant none as an Integer * fix null tests --------- Co-authored-by: dave-connors-3 <73915542+dave-connors-3@users.noreply.github.com> Co-authored-by: Dave Connors <dave.connors@fishtownanalytics.com> (cherry picked from commit be94bf1) Co-authored-by: Emily Rockman <emily.rockman@dbtlabs.com>
emmyoop
added a commit
that referenced
this pull request
Sep 7, 2023
2 tasks
emmyoop
added a commit
that referenced
this pull request
Sep 11, 2023
* update `Number` class to handle integer values (#8306) * add show test for json data * oh changie my changie * revert unecessary cahnge to fixture * keep decimal class for precision methods, but return __int__ value * jerco updates * update integer type * update other tests * Update .changes/unreleased/Fixes-20230803-093502.yaml --------- Co-authored-by: Emily Rockman <emily.rockman@dbtlabs.com> * account for integer vs number on table merges * add tests for combining number with integer. * add unit test when nulls are added * cant none as an Integer * fix null tests --------- Co-authored-by: dave-connors-3 <73915542+dave-connors-3@users.noreply.github.com> Co-authored-by: Dave Connors <dave.connors@fishtownanalytics.com>
colin-rogers-dbt
pushed a commit
that referenced
this pull request
Sep 11, 2023
* update `Number` class to handle integer values (#8306) * add show test for json data * oh changie my changie * revert unecessary cahnge to fixture * keep decimal class for precision methods, but return __int__ value * jerco updates * update integer type * update other tests * Update .changes/unreleased/Fixes-20230803-093502.yaml --------- * account for integer vs number on table merges * add tests for combining number with integer. * add unit test when nulls are added * cant none as an Integer * fix null tests --------- Co-authored-by: dave-connors-3 <73915542+dave-connors-3@users.noreply.github.com> Co-authored-by: Dave Connors <dave.connors@fishtownanalytics.com>
2 tasks
5 tasks
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #8153
docs dbt-labs/docs.getdbt.com/#
Problem
Agate tables, which power dbt show, and therefore the dbt cloud IDE, show integer values as decimals, leading to user confusion when columns seem to have decimals when they don't! this overrides that behavior in the dbt-core customization of the agate Number class
Solution
Ensure that the Number.cast() and Number.jsonify() methods properly handle integer values.
Also ensure it handles table merges appropriately.
Checklist