Skip to content

feat: add dt.tz_localize()#2469

Open
sycai wants to merge 6 commits intomainfrom
sycai_tz_localize
Open

feat: add dt.tz_localize()#2469
sycai wants to merge 6 commits intomainfrom
sycai_tz_localize

Conversation

@sycai
Copy link
Contributor

@sycai sycai commented Feb 19, 2026

Only None and "UTC" time zones are supported in this version.

Fixes b/481069646 🦕

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Feb 19, 2026
@sycai sycai marked this pull request as ready for review February 19, 2026 23:19
@sycai sycai requested a review from a team as a code owner February 19, 2026 23:19
@scalar_op_compiler.register_unary_op(ops.ToDatetimeOp, pass_op=True)
def to_datetime_op_impl(x: ibis_types.Value, op: ops.ToDatetimeOp):
if x.type() == ibis_dtypes.str:
if x.type() in (ibis_dtypes.str, ibis_dtypes.Timestamp("UTC")): # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you verify if the SQLGlot compiler requires similar handling? If it does, please enable bpd.options.experiments.sql_compiler = "experimental" and run the doc tests below. Thanks!

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 catch!! I forgot to update the SQLGlot compiler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you verify if the SQLGlot compiler requires similar handling? If it does, please enable bpd.options.experiments.sql_compiler = "experimental" and run the doc tests below. Thanks!

Updated the SQLGlot compiler and added tests. Also tested the code manually.

@sycai sycai requested a review from chelsea-lin February 20, 2026 01: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.

3 participants

Comments