ktmud commented on a change in pull request #12552:
URL: https://github.com/apache/superset/pull/12552#discussion_r563186213
##########
File path: superset/utils/date_parser.py
##########
@@ -71,19 +71,35 @@ def parse_human_datetime(human_readable: str) -> datetime:
>>> year_after_1 == year_after_2
True
"""
+ x_periods =
r"^\s*([0-9]+)\s+(second|minute|hour|day|week|month|quarter|year)s?\s*$"
+ if re.search(x_periods, human_readable, re.IGNORECASE):
+ raise ValueError(
+ _(
+ "date string is unclear."
Review comment:
```suggestion
"Date string is unclear."
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]