Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on May 7, 2026. It is now read-only.

feat: implement cos, sin, and log operations for polars compiler#2170

Merged
tswast merged 7 commits into
maingoogleapis/python-bigquery-dataframes:mainfrom
tswast-loggoogleapis/python-bigquery-dataframes:tswast-logCopy head branch name to clipboard
Oct 15, 2025
Merged

feat: implement cos, sin, and log operations for polars compiler#2170
tswast merged 7 commits into
maingoogleapis/python-bigquery-dataframes:mainfrom
tswast-loggoogleapis/python-bigquery-dataframes:tswast-logCopy head branch name to clipboard

Conversation

@tswast

@tswast tswast commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

Towards #2147 (using Polars in more doctests) 🦕

@tswast tswast requested review from a team and 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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor 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

tswast commented Oct 15, 2025

Copy link
Copy Markdown
Contributor Author

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.