Skip to content

Comments

feat: add dt.tz_localize()#2469

Merged
sycai merged 6 commits intomainfrom
sycai_tz_localize
Feb 20, 2026
Merged

feat: add dt.tz_localize()#2469
sycai merged 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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

@sycai sycai requested a review from chelsea-lin February 20, 2026 01:04
@sycai
Copy link
Contributor Author

sycai commented Feb 20, 2026

The notebook and sample test failures are related to multi-modals.

@sycai sycai merged commit f70f93a into main Feb 20, 2026
22 of 24 checks passed
@sycai sycai deleted the sycai_tz_localize branch February 20, 2026 18:29
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