Skip to content

Commit

Permalink
Update date_parser.py (#17426)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley authored Nov 12, 2021
1 parent bcef8fa commit bfc813d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion superset/utils/date_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ def eval(self) -> datetime:
month=1, day=1, hour=0, minute=0, second=0, microsecond=0
)
if unit == "quarter":
dttm = pd.Period(pd.Timestamp(dttm), freq="Q").to_timestamp()
dttm = (
pd.Period(pd.Timestamp(dttm), freq="Q").to_timestamp().to_pydatetime()
)
elif unit == "month":
dttm = dttm.replace(day=1, hour=0, minute=0, second=0, microsecond=0)
elif unit == "week":
Expand Down

0 comments on commit bfc813d

Please sign in to comment.