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 xml date/time nanoseconds #679

Merged
merged 1 commit into from
Apr 24, 2022
Merged

Support xml date/time nanoseconds #679

merged 1 commit into from
Apr 24, 2022

Conversation

tefra
Copy link
Owner

@tefra tefra commented Apr 23, 2022

📒 Description

The built-in datatypes for xml date/time only go up to milliseconds.
The w3c defintions says that fractional seconds could be an arbitary number.

Resolves #678

🔗 What I've Done

  • Updated the XmlDateTime, XmlTime to support up to nanoseconds (breaking compatibility change)

This shouldn't affect most people, that parse dates and then convert to the builtin python datetime/time objects, but if you construct the XmlDateTime/XmlTime manually and you used to pass milliseconds as a keyword argument, you will get an error. The argument now is called fractional_second and goes up to 999999999

💬 Comments

🛫 Checklist

@codecov
Copy link

codecov bot commented Apr 24, 2022

Codecov Report

Merging #679 (5ee172c) into master (f837948) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #679   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           95        95           
  Lines         8259      8268    +9     
  Branches      1589      1590    +1     
=========================================
+ Hits          8259      8268    +9     
Impacted Files Coverage Δ
xsdata/models/datatype.py 100.00% <100.00%> (ø)
xsdata/utils/dates.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f837948...5ee172c. Read the comment docs.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@tefra tefra merged commit 213fc6c into master Apr 24, 2022
@tefra tefra deleted the issue-678 branch April 24, 2022 08:59
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.

Unable to parse time with nanoseconds
1 participant