-
Notifications
You must be signed in to change notification settings - Fork 6
Add zoned date time generic impl #28
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
Merged
dschwartznyc
merged 7 commits into
finos:develop
from
priyanka-amarnani-th:add-zoned-date-time-generic-impl
Aug 25, 2025
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5602bd7
support for to-zoned-date-time generic implementation
priyanka-amarnani-th ae77c83
support for to-zoned-date-time generic implementation
priyanka-amarnani-th 5aac81b
Merge remote-tracking branch 'origin/feature/add-xoned-date-time-impl…
priyanka-amarnani-th 213e605
merge result
priyanka-amarnani-th 5f40562
Merge branch 'add-zoned-date-time-generic-impl' of https://github.com…
priyanka-amarnani-th b6f0e89
Merge branch 'develop' into add-zoned-date-time-generic-impl
priyanka-amarnani-th efe1118
Updated to_zoned_date_time import
priyanka-amarnani-th File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| setuptools>=62.0 | ||
| tzdata>=2023.3 | ||
| pytest |
38 changes: 29 additions & 9 deletions
38
test/python_unit_tests/semantics/test_to_zoned_date_time.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,42 @@ | ||
| '''to-zoned-date-time unit tests''' | ||
|
|
||
| import datetime | ||
| from zoneinfo import ZoneInfo | ||
|
|
||
| import pytest | ||
|
|
||
| from rosetta_dsl.test.semantic.zoned_date_time_operator.ZonedDateTimeOperatorTest import ZonedDateTimeOperatorTest | ||
| from rosetta_dsl.test.semantic.toZonedDateTimeOp.TestToZonedDateTimeOp import TestToZonedDateTimeOp | ||
|
|
||
|
|
||
| def test_to_zoned_date_time_offset_and_time_zone(): | ||
| to_zoned_date_time_test= TestToZonedDateTimeOp(a="2025-07-07 15:30:00 +0100 Europe/Lisbon",b=datetime.datetime(2025,7, 7, 15, 30, 0, tzinfo=ZoneInfo("Europe/Lisbon"))) | ||
| to_zoned_date_time_test.validate_model() | ||
|
|
||
| def test_to_zoned_date_time_only_time_zone(): | ||
| to_zoned_date_time_test= TestToZonedDateTimeOp(a="2025-07-07 15:30:00 Europe/Lisbon",b=datetime.datetime(2025,7, 7, 15, 30, 0, tzinfo=ZoneInfo("Europe/Lisbon"))) | ||
| to_zoned_date_time_test.validate_model() | ||
|
|
||
| def test_to_zoned_date_time_passes(): | ||
| '''no doc''' | ||
| to_zoned_date_time_test= ZonedDateTimeOperatorTest(a="2025-05-26 14:30:00 +0900 UTC",b=datetime.datetime(2025, 5, 26, 14, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(hours=9), 'UTC'))) | ||
| def test_to_zoned_date_time_only_time_zone2(): | ||
| to_zoned_date_time_test= TestToZonedDateTimeOp(a="2025-03-15 12:00:00 Zulu",b=datetime.datetime(2025,3, 15, 12, 0, 0, tzinfo=ZoneInfo("Zulu"))) | ||
| to_zoned_date_time_test.validate_model() | ||
|
|
||
| def test_to_zoned_date_time_only_offset(): | ||
| to_zoned_date_time_test= TestToZonedDateTimeOp(a="2025-05-26 14:30:00 +0900",b=datetime.datetime(2025,5, 26, 14, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(hours=9)))) | ||
| to_zoned_date_time_test.validate_model() | ||
|
|
||
| def test_to_zoned_date_time_fails(): | ||
| '''no doc''' | ||
| to_zoned_date_time_test= ZonedDateTimeOperatorTest(a="2025-05-26 14:30:00 +09x0 UTC",b=datetime.datetime(2025, 5, 26, 14, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(hours=9), 'UTC'))) | ||
| to_zoned_date_time_test= TestToZonedDateTimeOp(a="2025-12-15 15:30:00 +0100 Europe/Lisbon",b=datetime.datetime(2025, 5, 26, 14, 30, 0, tzinfo=ZoneInfo("Europe/Lisbon"))) | ||
| with pytest.raises(Exception): | ||
| to_zoned_date_time_test.validate_model() | ||
|
|
||
| def test_to_zoned_date_time_fails_format(): | ||
| to_zoned_date_time_test= TestToZonedDateTimeOp(a="2025-05-26 14:30:00 +09x0",b=datetime.datetime(2025, 5, 26, 14, 30, 0, tzinfo=datetime.timezone(datetime.timedelta(hours=9)))) | ||
| with pytest.raises(Exception): | ||
| to_zoned_date_time_test.validate_model() | ||
|
|
||
| if __name__ == "__main__": | ||
| test_to_zoned_date_time_passes() | ||
| test_to_zoned_date_time_fails() | ||
| test_to_zoned_date_time_offset_and_time_zone() | ||
| test_to_zoned_date_time_only_time_zone() | ||
| test_to_zoned_date_time_only_time_zone2() | ||
| test_to_zoned_date_time_only_offset() | ||
| test_to_zoned_date_time_fails() | ||
| test_to_zoned_date_time_fails_format() | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
believe this import and the class usage need to be aligned to the naming of the class created: ZonedDateTimeOperatorTest