EnxDev commented on code in PR #43017:
URL: https://github.com/apache/superset/pull/43017#discussion_r3913214453


##########
superset/commands/dashboard/export.py:
##########
@@ -48,6 +48,13 @@
 DEFAULT_CHART_WIDTH = 4
 
 
+def _coerce_dataset_id(raw_dataset_id: Any) -> Optional[int]:
+    try:
+        return int(raw_dataset_id)

Review Comment:
   Could we restrict this to actual integers and base-10 integer strings? 
`int()` also truncates floats (`1.9` becomes `1`) and accepts strings such as 
`"1_0"`, so malformed dashboard metadata can silently resolve and export a 
different dataset instead of being treated as a dangling reference. A small 
regression test with a non-integral value would help preserve the previous 
behavior.



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