sebastianliebscher commented on code in PR #24001:
URL: https://github.com/apache/superset/pull/24001#discussion_r1190899058


##########
superset/utils/core.py:
##########
@@ -1787,8 +1787,25 @@ def indexed(
     return idx
 
 
+def strtobool(val: str) -> bool:
+    """Convert a string representation of truth to true (1) or false (0).
+
+    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
+    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
+    'val' is anything else.
+
+    Original implementation from deprecated distutils.
+    """
+    val = val.lower()
+    if val in {"y", "yes", "t", "true", "on", "1"}:
+        return True
+    if val in {"n", "no", "f", "false", "off", "0"}:
+        return False
+    raise ValueError("invalid truth value %r" % (val,))

Review Comment:
   Thanks for your feedback! I consolidated `strtobool` and 
`parse_boolean_string`



-- 
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]

Reply via email to