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
issue161/BigQuery BIGNUMERIC column error #162
Conversation
# TODO(dhercher): DataType customizations shoould be moved to Ibis/third_party | ||
# BigQuery BIGNUMERIC support needs to be pushed to Ibis | ||
bigquery._pandas_helpers.BQ_TO_ARROW_SCALARS["BIGNUMERIC"] = pyarrow.string | ||
_DTYPE_TO_IBIS_TYPE["BIGNUMERIC"] = dt.string |
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.
Could you describe why BIGNUMERIC
and NUMERIC
are handled differently?
Also, I suspect you want float64
because Ibis has more aggregate functions implemented there than they do for the decimal data types? Could you comment on why we need to remap it here?
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.
An error occurs with float when it is attempted to be read to pandas. I believe this needs to wait until pyarrow. and full support is added too
Co-authored-by: Tim Swast <swast@google.com>
…gleCloudPlatform/professional-services-data-validator into issue161-support-bigquery-bignumeric
@classmethod | ||
def to_ibis_from_I2(cls, col_data, return_ibis_type=True): | ||
if return_ibis_type: | ||
return dt.int8 |
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.
what's the difference between to_ibis_from_I1
and to_ibis_from_I2
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.
I1 and I2 are the teradata datatypes for different int values, both are encapsulated by int8 though
The BIGNUMERIC datatype causes an error to be thrown in Ibis when getting schema. We can easily resolve this with the code supplied here to add Ibis support for BIGNUMERIC.
However, ideally the field should be defined as a numeric type. This would allow numeric aggregations and functions o be applied in Ibis. When we attempt to use
dt.Numeric(38,9)
then we get an error from the BigQuery client when executing the query.We are suggesting a temporary
dt.string
type to unblock schema conversion. However, this does not resolve the issue which will still crop up