-
Notifications
You must be signed in to change notification settings - Fork 109
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: Add support for numeric and precision with length and precision in Postgres Custom Query #723
Conversation
/gcbrun |
/gcbrun |
/gcbrun |
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.
Have you tested your code with non-numeric columns? I tried it with a date and got an error:
File "/usr/local/google/home/neiljohnson/github/professional-services-data-validator2/third_party/ibis/ibis_postgres/client.py", line 107, in _parse_numeric
return ty.parse(text)
File "/usr/local/google/home/neiljohnson/github/professional-services-data-validator2/.venv/lib/python3.10/site-packages/parsy/__init__.py", line 87, in parse
(result, _) = (self << eof).parse_partial(stream)
File "/usr/local/google/home/neiljohnson/github/professional-services-data-validator2/.venv/lib/python3.10/site-packages/parsy/__init__.py", line 101, in parse_partial
raise ParseError(result.expected, stream, result.furthest)
parsy.ParseError: expected one of 'decimal', 'numeric' at 0:0
I think you should add a unit test feeding each common data type string into the _get_type
function to be sure we don't get any exceptions.
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.
The test column triggering the exception is actually timestamp rather than date.
col_ts timestamp(6)
And looks like this from a describe:
Column | Type | Collation | Nullable | Default
--------------+--------------------------------+-----------+----------+---------
id | integer | | not null |
...
col_ts | timestamp(6) without time zone | | |
/gcbrun |
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
Closes #681