Skip to content

Commit ac92db1

Browse files
feat(python): add conversational analytics chat support and fix datetime parsing
1 parent f6ce528 commit ac92db1

4 files changed

Lines changed: 6135 additions & 8074 deletions

File tree

‎python/looker_sdk/rtl/hooks.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@ def datetime_structure_hook(
6868
def datetime_structure_hook(
6969
d: str, t: Type[datetime.datetime]
7070
) -> datetime.datetime:
71-
return datetime.datetime.strptime(d, DATETIME_FMT)
71+
if d.endswith("Z"):
72+
d = d[:-1] + "+00:00"
73+
try:
74+
return datetime.datetime.fromisoformat(d)
75+
except ValueError:
76+
return datetime.datetime.strptime(d, DATETIME_FMT)
77+
7278

7379

7480
def datetime_unstructure_hook(dt):

0 commit comments

Comments
 (0)