rusackas commented on code in PR #44620:
URL: https://github.com/apache/superset/pull/44620#discussion_r4111224494
##########
superset/utils/date_parser.py:
##########
@@ -349,7 +349,7 @@ def handle_nth_of(
"DATETRUNC(..., year) : DATEADD(DATETRUNC(..., year), 1, week)"
"""
# Convert ordinal to number
- n = ORDINAL_MAP.get(ordinal.lower(), int(ordinal) if ordinal.isdigit()
else 1)
+ n = ORDINAL_MAP.get(ordinal.lower(), int(ordinal) if ordinal.isdecimal()
else 1)
Review Comment:
codeant's off here. The ternary already guards `int()`:
`"first".isdecimal()` is False so it short-circuits to `1`, and `dict.get`'s
eager default never actually runs on a word in practice.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]