feat(dashboard): make permalink deterministic (#20632)

This commit is contained in:
Jesse Yang
2022-07-12 16:33:18 -07:00
committed by GitHub
parent 5317462b49
commit c3ac61271a
5 changed files with 37 additions and 16 deletions

View File

@@ -608,8 +608,9 @@ def json_int_dttm_ser(obj: Any) -> float:
return obj
def json_dumps_w_dates(payload: Dict[Any, Any]) -> str:
return json.dumps(payload, default=json_int_dttm_ser)
def json_dumps_w_dates(payload: Dict[Any, Any], sort_keys: bool = False) -> str:
"""Dumps payload to JSON with Datetime objects properly converted"""
return json.dumps(payload, default=json_int_dttm_ser, sort_keys=sort_keys)
def error_msg_from_exception(ex: Exception) -> str: