-
Notifications
You must be signed in to change notification settings - Fork 67
[AL-5784] Remove backports because it failed to installed on Windows #1119
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
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fd6231b
Use python dateutil package to parse iso strings
973016b
Remove backports
9aaeb72
Fix formatting
b78fbfb
Make tox.ini uptodate with supported python versions
4d25d85
Rename function
b2f348d
Add test
541d7c4
PR changes
2924dc9
Support for timezone conversion
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
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,19 +1,19 @@ | ||
requests==2.22.0 | ||
backoff==1.10.0 | ||
google-api-core>=1.22.1 | ||
pydantic>=1.8,<2.0 | ||
shapely | ||
tqdm | ||
geojson | ||
google-api-core>=1.22.1 | ||
imagesize | ||
nbconvert~=7.2.6 | ||
nbformat~=5.7.0 | ||
numpy | ||
PILLOW | ||
opencv-python | ||
imagesize | ||
pyproj | ||
PILLOW | ||
pydantic>=1.8,<2.0 | ||
pygeotile | ||
typing-extensions==4.5.0 | ||
pyproj | ||
pytest-xdist | ||
nbformat~=5.7.0 | ||
nbconvert~=7.2.6 | ||
python-dateutil>=2.8.2,<2.9.0 | ||
requests==2.22.0 | ||
shapely | ||
tqdm | ||
typeguard==2.13.3 | ||
backports-datetime-fromisoformat~=2.0 | ||
typing-extensions==4.5.0 |
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import pytest | ||
from labelbox.utils import format_iso_datetime, format_iso_from_string | ||
|
||
|
||
@pytest.mark.parametrize('datetime_str, expected_datetime_str', | ||
[('2011-11-04T00:05:23Z', '2011-11-04T00:05:23Z'), | ||
('2011-11-04T00:05:23+00:00', '2011-11-04T00:05:23Z'), | ||
('2011-11-04T00:05:23+05:00', '2011-11-03T19:05:23Z'), | ||
('2011-11-04T00:05:23', '2011-11-04T00:05:23Z')]) | ||
def test_datetime_parsing(datetime_str, expected_datetime_str): | ||
# NOTE I would normally not take 'expected' using another function from sdk code, but in this case this is exactly the usage in _validate_parse_datetime | ||
assert format_iso_datetime( | ||
format_iso_from_string(datetime_str)) == expected_datetime_str |
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
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.
From line 849, we take the
field.value
and convert it into string from the datetime usingformat_iso_datetime
. Sinceformat_iso_datetime
does not take into consideration the timezone, does that mean that the timezone information will get lost here?For instance, if user inputs
2011-11-04T00:05:23+05:00
as the date metadata, it looks like we'll be upserting2011-11-04T00:05:23
and the timezone value gets lost? Let me know if I'm not understanding this correctlyThere 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.
Time zone does get lost! This is existing before... that was my question - should I fix it?
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.
Yes, I know the original issue was to make sure the time string gets properly parsed if timezone passed in.. we should make this also properly parse the timezone, because otherwise, non-UTC timezones will not store accurate datetimes
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.
ok... to be clear
format_iso_from_string
is not a problem, as far as I remember from my testingformat_iso_datetime
is the problem, it just formats a string with aZ
time zone, no conversion. Those two functions are used together in the code (like to validate string is a valid datetime AND convert it back to string)