Skip to content

feat: add time_zone to Datetime results #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dfrankland
Copy link

@dfrankland dfrankland commented May 7, 2025

Motivation

Closes #32

Changes

allows setting a time zone for datetimes and checking if the values in the column matches it

Pertinent polars docs:
https://docs.pola.rs/user-guide/transformations/time-series/timezones/

allows setting a time zone for datetimes and checking if the values in the column matches it
Copy link

github-actions bot commented May 7, 2025

Thank you for opening this pull request! 👋🏼

This repository requires pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details
The subject "add `time_zone` to `Datetime` `result`s" found in pull request title "feat: add `time_zone` to `Datetime` `result`s" doesn't match the configured pattern "^[A-Z].+[^. ]$".

Comment on lines +351 to +379
(
dy.Date(),
[dt.date(2020, 1, 1), dt.date(2021, 1, 15), dt.date(2022, 12, 1)],
{},
),
(
dy.Date(resolution="1mo"),
[dt.date(2020, 1, 1), dt.date(2021, 1, 15), dt.date(2022, 12, 1)],
{"resolution": [True, False, True]},
),
(
dy.Time(),
[dt.time(12, 0), dt.time(13, 15), dt.time(14, 0, 5)],
{},
),
(
dy.Time(resolution="1h"),
[dt.time(12, 0), dt.time(13, 15), dt.time(14, 0, 5)],
{"resolution": [True, False, False]},
),
(
dy.Datetime(),
[
dt.datetime(2020, 4, 5),
dt.datetime(2021, 1, 1, 12),
dt.datetime(2022, 7, 10, 0, 0, 1),
],
{},
),
Copy link
Author

Choose a reason for hiding this comment

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

I added these since I wanted to double-check the negative case when nothing is specified, but I'm happy to remove them if you believe these are too verbose

@dfrankland dfrankland changed the title add time_zone to Datetime results feat: add time_zone to Datetime results May 7, 2025
@github-actions github-actions bot added the enhancement New feature or request label May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dy.Datetime() does not support time_unit and time_zone
1 participant