Skip to content

Conversation

@jialuoo
Copy link
Contributor

@jialuoo jialuoo commented Oct 30, 2025

Migrated the coalesce_op operator from Ibis 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 coalesce_op operator from Ibis 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 Oct 30, 2025
@jialuoo
Copy link
Contributor Author

jialuoo commented Nov 4, 2025

The ibis sql:

SELECT
  `t0`.`int64_col`,
  COALESCE(`t0`.`int64_too`, `t0`.`int64_col`) AS `int64_too`
FROM (
  SELECT
    `int64_col`,
    `int64_too`
  FROM `bigframes-dev.sqlglot_test.scalar_types`
) AS `t0`

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


@register_binary_op(ops.coalesce_op)
Copy link
Contributor

@chelsea-lin chelsea-lin Nov 4, 2025

Choose a reason for hiding this comment

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

Can you please enable the existing engine test test_engines_coalesce_op by adding "bq-sqlglot" to the "engine" parameters.

@pytest.mark.parametrize("engine", ["polars", "bq"], indirect=True)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, thanks.

@jialuoo jialuoo requested a review from chelsea-lin November 4, 2025 18:57
@jialuoo jialuoo merged commit 196f6df into main Nov 4, 2025
20 of 25 checks passed
@jialuoo jialuoo deleted the migrate-coalesce-op-to-sqlglot branch November 4, 2025 19: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