Skip to content

fix(bigquery): fix Interval precision is None and format interval to str #843

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

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

grieve54706
Copy link
Contributor

We found an error ibis.common.exceptions.IbisTypeError: Interval precision is None.
Because the BigQuery client returns the interval type in the schema, it is not with precision.
We found the BigQueryType of the ibis has a field default_interval_precision. We can override the class until the ibis fixes it.
We also handle the date offset type of pandas that is not serializable.

@grieve54706 grieve54706 requested a review from goldmedal October 23, 2024 08:46
@github-actions github-actions bot added bigquery ibis python Pull requests that update Python code labels Oct 23, 2024
@grieve54706
Copy link
Contributor Author

Follow issue ibis-project/ibis#10357



class BigQueryType(datatypes.BigQueryType):
default_interval_precision = "s"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this option? We set s here but the result still prints the microsecond 🤔 .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's different things. The field is for ibis transfer str to type. The printed result is from the pandas dataframe.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks 👍

Copy link
Contributor

@goldmedal goldmedal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @grieve54706 LGTM 👍

@goldmedal goldmedal merged commit 2ab72ba into main Oct 23, 2024
7 checks passed
@goldmedal goldmedal deleted the bugfix/interval-percision branch October 23, 2024 09:18
grieve54706 added a commit that referenced this pull request Dec 13, 2024
…str (#843)

* fix(bigquery): fix Interval precision is None and format interval to str

* chore: re-trigger ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bigquery ibis python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants