Skip to content

Commit

Permalink
Allow TIMESTAMP values to be None or empty
Browse files Browse the repository at this point in the history
  • Loading branch information
kaapstorm committed Jun 26, 2024
1 parent 5ac86e1 commit fde6216
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hq_superset/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,12 @@ def js_to_py_datetime(jsdt, preserve_tz=True):
datetime.datetime(2024, 2, 24, 14, 1, 25, 397469, tzinfo=datetime.timezone.utc)
>>> js_to_py_datetime(jsdt, preserve_tz=False)
datetime.datetime(2024, 2, 24, 14, 1, 25, 397469)
>>> js_to_py_datetime(None)
None
"""
if jsdt is None or jsdt == '':
return None
if preserve_tz:
if sys.version_info >= (3, 11):
return datetime.fromisoformat(jsdt)
Expand Down

0 comments on commit fde6216

Please sign in to comment.