Copilot commented on code in PR #35934:
URL: https://github.com/apache/superset/pull/35934#discussion_r2491647619


##########
superset/mcp_service/utils/permissions_utils.py:
##########
@@ -142,9 +142,9 @@ def get_allowed_fields(
     if not user:
         user = get_current_user()
 
-    # Get sensitive fields for this object type
-    sensitive_fields = SENSITIVE_FIELDS.get(object_type, set())
-    sensitive_fields.update(SENSITIVE_FIELDS.get("common", set()))
+    base=SENSITIVE_FIELDS.get(object_type, set())
+    common=SENSITIVE_FIELDS.get("common", set())
+    sensitive_fields= set(base)|set(common)

Review Comment:
   Redundant set conversions. The `.get(object_type, set())` calls already 
return sets, so wrapping them with `set()` again is unnecessary. Since `base` 
and `common` are already sets, use `sensitive_fields = base | common` directly.
   ```suggestion
       sensitive_fields = base | common
   ```



##########
superset/mcp_service/utils/permissions_utils.py:
##########
@@ -142,9 +142,9 @@ def get_allowed_fields(
     if not user:
         user = get_current_user()
 
-    # Get sensitive fields for this object type
-    sensitive_fields = SENSITIVE_FIELDS.get(object_type, set())
-    sensitive_fields.update(SENSITIVE_FIELDS.get("common", set()))
+    base=SENSITIVE_FIELDS.get(object_type, set())
+    common=SENSITIVE_FIELDS.get("common", set())
+    sensitive_fields= set(base)|set(common)

Review Comment:
   Missing spaces around assignment operators. Python PEP 8 requires spaces 
around assignment operators. Change `base=` to `base = `, `common=` to `common 
= `, and `sensitive_fields=` to `sensitive_fields = `.
   ```suggestion
       base = SENSITIVE_FIELDS.get(object_type, set())
       common = SENSITIVE_FIELDS.get("common", set())
       sensitive_fields = set(base) | set(common)
   ```



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