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
I'm using pyodata to get data from an url. Since the url contains a too far date in the past like "<d:StartDate>0001-01-01T00:00:00</d:StartDate>" I'm geting this error :"
value = datetime.datetime(1970, 1, 1, tzinfo=datetime.timezone.utc) + datetime.timedelta(milliseconds=int(value))
OverflowError: date value out of range"
I am really wondering what's the content of JSON because I tested pyodata with values for 0001-01-01T00:00:00 and also 9999-12-31T00:00:00 and both worked fine.
@asmaMdi Thank you very much indeed. The minimal value in your data is represented by the number -62135769600000 which is 172799999miliseconds greater than the current lowest value PyOData can read (-62135596800000).
If you subtract the date 0001-01-01T00:00:00 (your lowest value) from 1970-01-01T00:00:00 (OData base date) you get maximal value which -62135596800000.
importdatetimeint((datetime.datetime(year=1, day=1, month=1) -datetime.datetime(year=1970, day=1, month=1)).total_seconds()) *1000# result = -62135596800000
If you subtract your lowest value from PyOData lowest value and add the result to the OData zero date, you get 1970-01-02T23:59:999000.
@asmaMdi thank you for the follow up. I am going to close this issue and I would like to ask you to re-open, if the service provider does not fix the issue on their side. I would like to thank you for your cooperation and patience.
Activity
filak-sap commentedon Jan 29, 2020
Thank you for taking the time to report the issue and sorry for the late reply.
Can you please send me the data in JSON format? (Add
$format=jsonto URL).asmaMdi commentedon Feb 3, 2020
Hi,
Thank you for your reply please find attached json file because I'm not allowed to put the url
EmployeeData.zip
filak-sap commentedon Feb 6, 2020
@asmaMdi I'm sorry but you provided XML. It's not enough to store it in *.json you need to download it as JSON.
The following examples shows the difference:
Example XML:
https://services.odata.org/V2/Northwind/Northwind.svc/Employees
Example JSON:
https://services.odata.org/V2/Northwind/Northwind.svc/Employees?$format=json
test: validate parsing boundary values JSON Dates
filak-sap commentedon Feb 7, 2020
I am really wondering what's the content of JSON because I tested pyodata with values for 0001-01-01T00:00:00 and also 9999-12-31T00:00:00 and both worked fine.
asmaMdi commentedon Feb 10, 2020
Hi,
sorry for my delayed response. Please find attached file.
EmployeeData.zip
filak-sap commentedon Feb 10, 2020
@asmaMdi Thank you very much indeed. The minimal value in your data is represented by the number -62135769600000 which is 172799999miliseconds greater than the current lowest value PyOData can read (-62135596800000).
If you subtract the date 0001-01-01T00:00:00 (your lowest value) from 1970-01-01T00:00:00 (OData base date) you get maximal value which -62135596800000.
If you subtract your lowest value from PyOData lowest value and add the result to the OData zero date, you get 1970-01-02T23:59:999000.
Can you, please, report the issue to your OData service provider?
An excerpt of you data:
{"__metadata":{"uri":"https://{REMOVED_HOST}/sap/byd/odata/cust/v1/odata_project/EmployeeEmployeeTypeCollection('0000000000011EE181BFC430CB1AAE84')", "type":"cust.EmployeeEmployeeType"}, "ObjectID":"0000000000011EE181BFC430CB1AAE84", "ParentObjectID":"0000000000011EE181BFC41244F70E84", "EndDate":"\/Date(253402214400000)\/", "StartDate":"\/Date(-62135769600000)\/", "InternalEmployeeIndicator":false,The corresponding XML excerpt:
asmaMdi commentedon Feb 12, 2020
Thank your for your response. I will see with the OData service provider.
filak-sap commentedon Feb 12, 2020
@asmaMdi If they refuse to fix the problem on their side, we will find a way how to work around this issue.
asmaMdi commentedon Feb 13, 2020
Great! Thank you very much
I reported the problem to the OData service provider.
Thank you
filak-sap commentedon Feb 24, 2020
@asmaMdi thank you for the follow up. I am going to close this issue and I would like to ask you to re-open, if the service provider does not fix the issue on their side. I would like to thank you for your cooperation and patience.
squeakyboots commentedon Apr 3, 2020
@asmaMdi did you hear back from the provider? I also seem to be facing this issue on ByD and am curious what the outcome was.