-
Notifications
You must be signed in to change notification settings - Fork 560
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
Redo XSD Datetime, Date, Time, Duration parser and serializers #2929
Merged
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
a3f4ba4
New xsd_datetime module, with parsers and serializers for XSD_Duratio…
ashleysommer 2852c10
ruff fixes in test suite changes
ashleysommer 4695333
Fix a failing test
ashleysommer f21953e
Add missing exports to xsd_datetime
ashleysommer a9f3c9e
Fix some version constraints to help CI tests pass
ashleysommer 6c156e0
Fix generating negative duartion strings. This fixes the broken doctest.
ashleysommer d7953ce
Fix black formatting in xsd_datetime _again_.
ashleysommer 52eee4c
Add isodate back into the dockerfile requirements so that can still b…
ashleysommer 5531b46
correctly calculate total years in Duration constructor.
ashleysommer e9d5998
Fix some docstring generation errors
ashleysommer d605532
For documentation-generation reasons, don't re-export builtin parsers…
ashleysommer 4af6fd4
Merge branch 'main' into xsd_datetime_parse
nicholascar 6154e53
Add ashleysommer to contributors list on the xsd_datetime module.
ashleysommer 56bb776
Fix wording in xsd_datetime header.
ashleysommer 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 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,11 +1,11 @@ | ||
# This file selects minimum versions to ensure that the test suite passes on | ||
# these versions. The file's extension (`.min`) is chosen to evade Dependabot | ||
# which operates on `*.{txt,in}` files. | ||
isodate==0.6.0 | ||
isodate==0.7.2; python_version < "3.11" | ||
pyparsing==2.1.0 | ||
importlib-metadata==4.0.0 | ||
berkeleydb==18.1.2 | ||
networkx==2.0 | ||
html5lib==1.0.1 | ||
html5lib-modern==1.2.0 | ||
lxml==4.3.0 | ||
orjson==3.9.14 |
This file contains 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,4 +1,6 @@ | ||
# This file is used for building a docker image of hte latest rdflib release. It | ||
# This file is used for building a docker image of the latest rdflib release. It | ||
# will be updated by dependabot when new releases are made. | ||
rdflib==7.0.0 | ||
html5lib | ||
html5lib-modern==1.2.0 | ||
# isodate is required to allow the Dockerfile to build on with pre-RDFLib-7.1 releases. | ||
isodate==0.7.2 |
This file contains 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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
Oops, something went wrong.
Oops, something went wrong.
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.
This was a required change because previous implementation used tzinfo instances (timezone instances) from
isodate
, but the new implementation always uses timezones from the stdlib. The SPARQL builtinTZ()
will return the "timezone name" if known, in python this uses thetzname()
function.The difference is that stdlib timezones and isodate timezones have different
tzname()
generation pattern. Inisodate
an unnamed timezone with "-5H" offset will be have tzname of "-05:00", but in stdlib an unnamed timezone with "-5H" offset will have tzname of "UTC-05:00" (more correct IMHO).So for consistency and backwards compatibility, this change was added to normalize the tzname output, I tested Jena's
TZ()
SPARQL function too, and it also outputs "-05:00" likeisodate
did.