You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Recently i am using pyodata to retrieve backend data.
Issue is that i still receive a datetime object (2000,01,01) for a date that is empty at the backend. And i saw this is the default date set during initialization.
Is there a way to tell whether the date i received is empty or it's a real date that is 2000 jan 1st.
i am not sure that make sense to do additional post requests since we are already getting data though this pyodata.
Will it be possible a quick fix to change the default date to a more unrealistic date like 1000-01-01 or 1900-01-01? so that anyone look at it will know it's not an actual date. just suggestion.
if no change will happen from your side, i am planning to do this.
if the date do not has a timezone information (.tzinfo) and the date is 2000-01-01, i will consider it as a default setting. Do you think this makes sense?
I have no idea why we used 2000-01-01 - perhaps, that's how Business gateway handles Null DateTime values.
I asked for the response from the server to see how the server handles non-set date. If I learn how server handles it, I might be able to use None or something more appropriate.
If/When #189 got merged, users of this library will be able to detect missing properties and act on it - including setting a different/custom (default) time.
Activity
jfilak commentedon Dec 18, 2019
Unfortunately, I cannot see any way how to differentiate between no date and 2000-01-01. Can you post the XML/JSON response from the server, please?
trancyQ commentedon Dec 18, 2019
i am not sure that make sense to do additional post requests since we are already getting data though this pyodata.
Will it be possible a quick fix to change the default date to a more unrealistic date like 1000-01-01 or 1900-01-01? so that anyone look at it will know it's not an actual date. just suggestion.
trancyQ commentedon Dec 18, 2019
if no change will happen from your side, i am planning to do this.
if the date do not has a timezone information (.tzinfo) and the date is 2000-01-01, i will consider it as a default setting. Do you think this makes sense?
jfilak commentedon Dec 18, 2019
I would go for the lowest allowed value which is:
https://www.odata.org/documentation/odata-version-2-0/overview/
I have no idea why we used 2000-01-01 - perhaps, that's how Business gateway handles Null DateTime values.
I asked for the response from the server to see how the server handles non-set date. If I learn how server handles it, I might be able to use
Noneor something more appropriate.jfilak commentedon Dec 18, 2019
I choose the value without thinking I guess and it make sense to change it to something less common.
trancyQ commentedon Dec 19, 2019
Thank you. this will be very helpful.
jfilak commentedon Dec 19, 2019
Sure, but can you please post your server response? Or at least the part where I can see what the server returns for empty date?
filak-sap commentedon Feb 25, 2020
@trancyQ Would it work for you to use None for empty Date. I think it is a rational value.
service: Support null (SAP#79)
service: Support null (SAP#79)
service: Support null (SAP#79)
service: Support null (SAP#79)
service: Support null (SAP#79)
service: Support null (SAP#79)
rettichschnidi commentedon Jan 26, 2022
If/When #189 got merged, users of this library will be able to detect missing properties and act on it - including setting a different/custom (default) time.
model: adjust default Edm.Date value (SAP#79)
service: Support null (SAP#79)
service: Support null (SAP#79)
model: adjust default Edm.Date value (SAP#79)
model: adjust default Edm.DateTime value (SAP#79)
service: Support null (SAP#79)
model: adjust default Edm.DateTime value (SAP#79)
service: Support null (SAP#79)
model: adjust default Edm.DateTime value (#79)
service: Support null (SAP#79)
service: Support null (#79)
rettichschnidi commentedon Feb 27, 2022
#189 got merged. Proposing to close this issue.