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
Create a product document with name say ls8_derived . Attempt to index into this product a dataset document with product name say derived . The error code is triggered. However if the dataset document contains datetime data such as
properties:
datetime: 2024-04-18 06:18:48.308360Z
The error will fail to serialize. Since the YAML reader is datetime aware and creates a datetime object which the JSON serializer cannot convert back to string since Python's built in JSON serializer cannot serialize datetime objects.
This sort of roundtripping error is demonstrated below:
>>>importyaml, json>>>data=yaml.full_load(open('20130327.yaml'))
>>>json.dumps(data)
Traceback (mostrecentcalllast):
File"<stdin>", line1, in<module>File"/usr/lib/python3.10/json/__init__.py", line231, indumpsreturn_default_encoder.encode(obj)
File"/usr/lib/python3.10/json/encoder.py", line199, inencodechunks=self.iterencode(o, _one_shot=True)
File"/usr/lib/python3.10/json/encoder.py", line257, initerencodereturn_iterencode(o, 0)
File"/usr/lib/python3.10/json/encoder.py", line179, indefaultraiseTypeError(f'Object of type {o.__class__.__name__} 'TypeError: Objectof type datetimeisnotJSONserializable
Environment information
Which datacube --version are you using? - Open Data Cube core, version 1.8.18
What datacube deployment/enviornment are you running against? - CSIRO AquaWatch Data Services
Note: Stale issues will be automatically closed after a period of six months with no activity.
To ensure critical issues are not closed, tag them with the Github pinned tag.
If you are a community member and not a maintainer please escalate this issue to maintainers via GIS StackExchange or Slack.
The text was updated successfully, but these errors were encountered:
Expected behaviour
If a single product matcher fails it correctly shows errors generated.
Actual behaviour
Due to Python builtin JSON serialize usage non-string internal representation of datetime fails to serialize producing errors such as one below.
Steps to reproduce the behaviour
Create a product document with name say
ls8_derived
. Attempt to index into this product a dataset document with product name sayderived
. The error code is triggered. However if the dataset document contains datetime data such asThe error will fail to serialize. Since the YAML reader is datetime aware and creates a datetime object which the JSON serializer cannot convert back to string since Python's built in JSON serializer cannot serialize datetime objects.
This sort of roundtripping error is demonstrated below:
Environment information
datacube --version
are you using? -Open Data Cube core, version 1.8.18
CSIRO AquaWatch Data Services
The text was updated successfully, but these errors were encountered: