Skip to content

Commit

Permalink
feat(api): handle literal timestamps with timezone embedded in string
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and kszucs committed Jun 16, 2022
1 parent eba0859 commit 1ae976b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ibis/expr/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,10 @@ def _timestamp_from_str(
value = pd.Timestamp(value, tz=timezone)
except pd.errors.OutOfBoundsDatetime:
value = dateutil.parser.parse(value)
return literal(value, type=dt.Timestamp(timezone=timezone))
dtype = dt.Timestamp(
timezone=timezone if timezone is not None else value.tzname()
)
return literal(value, type=dtype)


@functools.singledispatch
Expand Down

0 comments on commit 1ae976b

Please sign in to comment.