Skip to content

fix: correct the numeric literal dtype #365

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
Feb 14, 2024
Merged

Conversation

chelsea-lin
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a internal bug
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes internal bug: b/323070618 🦕

@chelsea-lin chelsea-lin requested review from a team as code owners February 1, 2024 22:56
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Feb 1, 2024
@@ -378,11 +378,13 @@ def literal_to_ibis_scalar(
scalar_expr = ibis.literal(literal, ibis_dtypes.float64)
elif scalar_expr.type().is_integer():
scalar_expr = ibis.literal(literal, ibis_dtypes.int64)
elif scalar_expr.type().is_decimal():
Copy link
Collaborator

Choose a reason for hiding this comment

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

This would break BIGNUMERIC, I think. We should probably have something that goes to the nearest type. https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#decimal_types

Like is_decimal and precision < 76, then this otherwise set to the precision and scale for BIGNUMERIC.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point! thanks!

@chelsea-lin chelsea-lin force-pushed the main_chelsealin_taxibug branch 2 times, most recently from eb3489e to 68108ac Compare February 12, 2024 23:16
@chelsea-lin chelsea-lin force-pushed the main_chelsealin_taxibug branch from 68108ac to f81077a Compare February 13, 2024 18:14
@chelsea-lin chelsea-lin merged commit 93b02cd into main Feb 14, 2024
@chelsea-lin chelsea-lin deleted the main_chelsealin_taxibug branch February 14, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants