Open
Description
We have a date field on ES8 with the following mapping
"date": {"type": "date"},
But we are getting a validation format
failed to parse date field [2025-03-26T20:25:00-22:00] with format [strict_date_optional_time\|\|epoch_millis]
Due to the lack of the decimal places of the seconds.
We are sending a datetime object so it's triggering this line
.isoformat()
however isoformat
for datetime has a behavior that if there are not microseconds it will use the second level precision https://github.com/python/cpython/blob/95d9dea1c4ed1b1de80074b74301cee0b38d5541/Lib/_pydatetime.py#L177-L179
I can work around this by subclassing the JsonSerializer
and adding an overwrite for datetimes, however is there a more permanent solution you could implement in the python client?
Metadata
Metadata
Assignees
Labels
No labels