-
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
fix csv precision #684
fix csv precision #684
Conversation
Used the file in #683 to test, also wrote unit tests for that max_digits fn |
@cmcarthur lgtm! Nice job on that test |
test/unit/test_utils.py
Outdated
@@ -1,5 +1,7 @@ | |||
import unittest | |||
|
|||
from decimal import Decimal |
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.
is this needed?
not a fan of that code climate "duplicate code" check that's currently failing btw. duplicate code is not always bad, trying to solve it often makes for more complicated code. |
right there with you @joevandyk -- sometimes no abstraction is better than a bad abstraction |
I confirmed this fixed my issue with loading the csv file. I think getting rid of the datatype limits is a good idea, as it allows for the truncate/insert strategy with different lengths of data. |
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.
lgtm!
dbt 0.9.2 RC had a bug where we miscalculate the precision required for decimal values like
0.001
. we were attempting to create anumeric(1,3)
which doesn't make sense -- according to the Postgres docs:So the precision should be 4, not 1. This branch fixes that.