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

model: fix default Edm.DateTimeOffset value (#195) #197

Conversation

rettichschnidi
Copy link
Contributor

Default value was broken in several ways:

  • Month 0 does not exist
  • Day 0 does not exist
  • Year 0 can not be handled by Python datetime

The new default value is copied from Edm.DateTime for consistency reasons. However, choosing something less common like 1.1.1 or 1.1.1970 might be more sensible?

@phanak-sap
Copy link
Contributor

Well, since the Edm.DateTime default value is also causing problems, as you find out in issue #79, why not change both Edm.DateTime and Edm.DateTimeOffset to the January 1, 1753 A.D, noted in this comment

#79 (comment)

@phanak-sap
Copy link
Contributor

note: not sure why, but build was not triggered for this PR

@phanak-sap phanak-sap added this to the 1.8.1 milestone Jan 27, 2022
@filak-sap
Copy link
Contributor

Could you please rebase to the latest master (I don't like merge commits).

Copy link
Contributor

@phanak-sap phanak-sap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking that the defaults for both Edm.DateTimeOffset and Edm.DateTime should be January 1, 1753 A.D

@rettichschnidi rettichschnidi force-pushed the rs/upstream/fix-default-Edm.DateTimeOffset-value branch 3 times, most recently from 22fbe4c to 4293d43 Compare January 28, 2022 18:45
Default value was broken in several ways:
- Month 0 does not exist
- Day 0 does not exist
- Year 0 can not be handled by Python datetime
This makes it easier, more likely, to spot dates fixed-up by pyodata.

The new value aligns with Edm.DateTimeOffset.
@rettichschnidi rettichschnidi force-pushed the rs/upstream/fix-default-Edm.DateTimeOffset-value branch from 4293d43 to a264bac Compare January 29, 2022 08:34
@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2022

Codecov Report

Merging #197 (a264bac) into master (0b353de) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #197      +/-   ##
==========================================
+ Coverage   92.66%   92.81%   +0.14%     
==========================================
  Files           6        6              
  Lines        2768     2768              
==========================================
+ Hits         2565     2569       +4     
+ Misses        203      199       -4     
Impacted Files Coverage Δ
pyodata/v2/model.py 93.37% <100.00%> (+0.05%) ⬆️
pyodata/v2/service.py 91.00% <0.00%> (+0.33%) ⬆️

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 0b353de...a264bac. Read the comment docs.

@phanak-sap
Copy link
Contributor

Thanks for the fix. Good work.

@phanak-sap phanak-sap merged commit 5e4b5a8 into SAP:master Jan 31, 2022
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.

None yet

4 participants