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

Fix year zero in dates #1153

Merged
merged 1 commit into from
Jul 3, 2024
Merged

Fix year zero in dates #1153

merged 1 commit into from
Jul 3, 2024

Conversation

dirkkul
Copy link
Collaborator

@dirkkul dirkkul commented Jul 3, 2024

Closes #1093

Weaviate accepts dates based on RFC3339 which allows the year zero ("0000-01-30T00:00:00Z"). However the datetime library is based on the gregorian calendar which does not have a year zero.

To fix parsing problems we will return years with 0 as the minimum date that is possibel in datetime (datetime.datetime(1, 1, 1, 0, 0)) and emit a warning.

weaviate/warnings.py Show resolved Hide resolved
mock_tests/test_collection.py Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.56%. Comparing base (42fb96c) to head (7ee5338).
Report is 88 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1153      +/-   ##
==========================================
- Coverage   94.68%   94.56%   -0.13%     
==========================================
  Files         190      193       +3     
  Lines       18932    19221     +289     
==========================================
+ Hits        17926    18176     +250     
- Misses       1006     1045      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dirkkul dirkkul merged commit 28ac501 into main Jul 3, 2024
42 checks passed
@dirkkul dirkkul deleted the fix_year_zero branch July 3, 2024 10:25
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.

Date time format - bad parse?
3 participants