Skip to content

Conversation

chelsea-lin
Copy link
Contributor

This change contains three commits generated by Gemini CLI tool:

  • Migrated cosh_op, tanh_op, arcsinh_op, arccosh_op, and arctanh_op scalar operators to SQLGlot.
  • Migrated abs_op, capitalize_op, ceil_op, date_op, and day_op scalar operators to SQLGlot.
  • Migrated dayofweek_op, dayofyear_op, exp_op, expm1_op, and floor_op scalar operators to SQLGlot.

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 Jul 21, 2025
@chelsea-lin chelsea-lin marked this pull request as ready for review July 21, 2025 22:53
@chelsea-lin chelsea-lin requested review from a team as code owners July 21, 2025 22:53
@chelsea-lin chelsea-lin requested a review from GarrettWu July 21, 2025 22:53
def test_arctanh(scalar_types_df: bpd.DataFrame, snapshot):
bf_df = scalar_types_df[["float64_col"]]
sql = _apply_unary_op(bf_df, ops.arctanh_op, "float64_col")
snapshot.assert_match(sql, "out.sql")
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you can update your Gemini prompt such that the generated tests always have empty lines between arrange/action/assert blocks? 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes were generated by Gemini on the old code (with no empty lines). I missed adding the empty lines when cherry picked these commits. I will keep on eyes that if Gemini can add empty lines for new generated codes. Fixed. Thanks.

@chelsea-lin chelsea-lin force-pushed the main_chelsealin_migratescalar branch 2 times, most recently from f7ad7c6 to c3e48ac Compare July 22, 2025 17:24
@chelsea-lin chelsea-lin requested a review from sycai July 22, 2025 17:28
# Plus 1 because iso day of week uses 1-based indexing
return sge.Extract(
this=sge.Identifier(this="DAYOFWEEK"), expression=expr.expr
) + sge.convert(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be minus 1 because SQL uses 1-based indexing while Pandas uses 0-based

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. Thanks!

Migrated cosh_op, tanh_op, arcsinh_op, arccosh_op, and arctanh_op scalar operators to SQLGlot.
Migrated operators:
- abs_op
- capitalize_op
- ceil_op
- date_op
- day_op
Migrated operators:
- dayofweek_op
- dayofyear_op
- exp_op
- expm1_op
- floor_op
@chelsea-lin chelsea-lin force-pushed the main_chelsealin_migratescalar branch from c3e48ac to 08158a5 Compare July 22, 2025 19:50
@chelsea-lin chelsea-lin requested a review from sycai July 22, 2025 19:51
@chelsea-lin chelsea-lin force-pushed the main_chelsealin_migratescalar branch from 08158a5 to d7b2f2e Compare July 22, 2025 19:52
@chelsea-lin chelsea-lin merged commit 07bce8e into main Jul 22, 2025
18 of 25 checks passed
@chelsea-lin chelsea-lin deleted the main_chelsealin_migratescalar branch July 22, 2025 20:15
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