frafra commented on issue #15905: URL: https://github.com/apache/superset/issues/15905#issuecomment-929261346
The function `json_iso_dttm_ser` is almost identical, but it tries to convert to ISO format instead of an integer, and it has support for `time`: https://github.com/apache/superset/blob/27a40d2a675fc2f9031eb1c072da046248c069ea/superset/utils/core.py#L587-L588 In case of `time`, `.isoformat()` is equivalent to `str(...)`: ` __str__ = isoformat` (https://github.com/python/cpython/blob/84975146a7ce64f1d50dcec8311b7f7188a5c962/Lib/datetime.py#L1434) As a time without a date cannot be converted to an integer with respect to EPOCH, we should decide if it would make more sense to convert it to seconds (from the beginning of the midnight) or to a string. `datetime.time` has no `total_seconds()` method or similar, so I would suggest converting it to a string, which seems the safest solution. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
