Skip to content

Conversation

chelsea-lin
Copy link
Contributor

Fixes internal issue 430133370 🦕

@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Aug 14, 2025
@chelsea-lin chelsea-lin marked this pull request as ready for review August 14, 2025 23:38
@chelsea-lin chelsea-lin requested review from a team as code owners August 14, 2025 23:38
@chelsea-lin chelsea-lin requested a review from tswast August 14, 2025 23:38
# `inf`` for float in BQ so we short-circuit in this case.
# Multiplying left by zero propogates nulls.
zero_result = (
constants._INF
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to do -inf for negative values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The expression zero_result * left_expr below is able to correctly handle the -inf case. This is demonstrated by the screenshot, which compares the results from the Ibis and SQLGlot frameworks. The Ibis results are shown on the left, while the SQLGlot results are on the right. To be mentioned, the sqlglot SQL is not compact and pending for optimizations.

@GarrettWu GarrettWu removed their assignment Aug 18, 2025
@chelsea-lin chelsea-lin force-pushed the main_chelsealin_floordiv branch from 31b2d36 to 94b2ce9 Compare August 19, 2025 22:30
@chelsea-lin chelsea-lin requested a review from tswast August 19, 2025 22:35
@chelsea-lin chelsea-lin force-pushed the main_chelsealin_floordiv branch from a4e2bba to ae69c7a Compare August 19, 2025 22:53
@chelsea-lin chelsea-lin merged commit 1445c98 into main Aug 20, 2025
21 of 25 checks passed
@chelsea-lin chelsea-lin deleted the main_chelsealin_floordiv branch August 20, 2025 21:30
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: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants