Skip to content
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

Support for timezone argument in calendar operators #301

Merged
merged 6 commits into from Nov 9, 2023

Conversation

DonBraulio
Copy link
Collaborator

@DonBraulio DonBraulio commented Nov 2, 2023

Adds support to specify the timezone in calendar operators, using the timezone name (e.g: America/Montevideo) or an offset in hours (e.g: -3) in the argument tz.

To ease serialization, the core operator only receives the offset in hours.

Copy link

github-actions bot commented Nov 2, 2023

Coverage report

Main: 91.10% | PR: 91.12% | Diff: 0.02 ✅

Copy link
Collaborator

@ianspektor ianspektor left a comment

Choose a reason for hiding this comment

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

Great work! 🙌🏼

temporian/core/event_set_ops.py Outdated Show resolved Hide resolved
temporian/core/event_set_ops.py Show resolved Hide resolved
from temporian.test.utils import assertOperatorResult, i32


class CalendarTimezoneTest(TestCase):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel these tests might be easier to miss here than if they were in each operator's test file - is there a reason to have them here together?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The reason is I don't want to duplicate the very specific setUp() code, and also it's easier to check that I'm testing that the argument is connected in all operators.
I agree it's easy to miss the file though, so I renamed it to test_base_timezone and now it appears on top together with test_base.py (which already existed and tests other generic stuff).

temporian/core/operators/calendar/base.py Outdated Show resolved Hide resolved
temporian/core/operators/calendar/base.py Outdated Show resolved Hide resolved
temporian/core/operators/calendar/base.py Outdated Show resolved Hide resolved
@google google deleted a comment from github-actions bot Nov 6, 2023
@google google deleted a comment from github-actions bot Nov 6, 2023
Copy link

github-actions bot commented Nov 7, 2023

Coverage report

Main: 91.11% | PR: 91.13% | Diff: 0.02 ✅

@DonBraulio DonBraulio merged commit 1b95f3c into main Nov 9, 2023
20 checks passed
@DonBraulio DonBraulio deleted the calendar-ops-timezone branch November 9, 2023 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants