-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
Response of actinia requests may contain datetime values. Those are currently returned as string.
While it is easy to transform those to datetime objects, a question is whether e.g. the request_and_check function in utils.py should parse and datetime objects by default, using an object_hook for datetime here:
| return json.loads(resp.text) |
The object hook would look something like this:
from datetime import datetime
def datetime_hook(json_dict):
for (key, value) in json_dict.items():
try:
json_dict[key] = datetime.fromisoformat(value)
except:
pass
return json_dict
(...)
json.loads(response, object_hook=datetime_hook)What do you think @mmacata
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested