dpgaspar commented on code in PR #23330:
URL: https://github.com/apache/superset/pull/23330#discussion_r1136733238
##########
superset/models/dashboard.py:
##########
@@ -450,11 +451,27 @@ def get(cls, id_or_slug: Union[str, int]) -> Dashboard:
return qry.one_or_none()
+def is_uuid(value: Union[str, int]) -> bool:
+ try:
+ uuid.UUID(str(value))
+ return True
+ except ValueError:
+ return False
+
+
+def is_int(value: Union[str, int]) -> bool:
+ try:
+ int(value)
+ return True
+ except ValueError:
+ return False
+
+
def id_or_slug_filter(id_or_slug: Union[int, str]) -> BinaryExpression:
Review Comment:
should we change this method name also?
##########
superset/dashboards/dao.py:
##########
@@ -41,21 +42,28 @@ class DashboardDAO(BaseDAO):
@classmethod
def get_by_id_or_slug(cls, id_or_slug: Union[int, str]) -> Dashboard:
Review Comment:
should we change this method name to `get_by_id_slug_or_uuid`?
--
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]