Skip to content

Conversation

@jialuoo
Copy link
Contributor

@jialuoo jialuoo commented Nov 4, 2025

Migrated the arctan2_op operator to SQLGlot.

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 bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes b/447388852 🦕

Migrated the arctan2_op operator to SQLGlot.
@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 Nov 4, 2025
@jialuoo
Copy link
Contributor Author

jialuoo commented Nov 4, 2025

The ibis sql:

SELECT
  atan2(`t0`.`int64_col`, `t0`.`float64_col`) AS `int64_col`
FROM (
  SELECT
    `int64_col`,
    `float64_col`
  FROM `bigframes-dev.sqlglot_test.scalar_types`
) AS `t0`

@jialuoo jialuoo requested a review from chelsea-lin November 4, 2025 23:31
@jialuoo jialuoo marked this pull request as ready for review November 4, 2025 23:31
@jialuoo jialuoo requested review from a team as code owners November 4, 2025 23:31


def test_arctan2(scalar_types_df: bpd.DataFrame, snapshot):
bf_df = scalar_types_df[["int64_col", "float64_col"]]
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add "bool_col" and then compare the Ibis results. Sometime, we may need "CAST(bool_col, INT64)" before calculating "ATAN2"

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. Fixed.

@jialuoo jialuoo requested a review from chelsea-lin November 6, 2025 19:25
@chelsea-lin chelsea-lin merged commit a2b97ed into main Nov 10, 2025
25 checks passed
@chelsea-lin chelsea-lin deleted the feat/migrate-arctan2-op branch November 10, 2025 17:47
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