Skip to content

Conversation

@tswast
Copy link
Collaborator

@tswast tswast commented Oct 15, 2025

Towards #2147 (using Polars in more doctests) 🦕

@tswast tswast requested review from a team as code owners October 15, 2025 17:05
@tswast tswast requested a review from shuoweil October 15, 2025 17:05
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Oct 15, 2025
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. label Oct 15, 2025
) -> pl.Expr:
import polars as pl

return pl.when(input < -1).then(float("nan")).otherwise((input + 1).log())
Copy link
Contributor

Choose a reason for hiding this comment

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

not input <= -1 and likewise for other log ops?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. log(0) is out of the domain. I have also updated this in the SQLGlot implementation that inspired this.

) -> pl.Expr:
import polars as pl

return pl.when(input <= 0).then(float("nan")).otherwise(input.sqrt())
Copy link
Contributor

Choose a reason for hiding this comment

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

seems sqrt 0 should be 0, not nan?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep. Just pushed some commits fixing.

@tswast
Copy link
Collaborator Author

tswast commented Oct 15, 2025

Samples failure: multimodal_test.py::test_multimodal_dataframe

e2e failures: timeout on tests/system/large/functions/test_remote_function.py::test_remote_function_unnamed_removed_w_session_cleanup

These seem unrelated to my change.

@tswast tswast requested a review from TrevorBergeron October 15, 2025 19:45
@tswast tswast merged commit 5613e44 into main Oct 15, 2025
21 of 25 checks passed
@tswast tswast deleted the tswast-log branch October 15, 2025 21:04
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: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants