korbit-ai[bot] commented on code in PR #35934:
URL: https://github.com/apache/superset/pull/35934#discussion_r2482381699


##########
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:
   Understood. Let's consider these alternatives:
   
   1. Use set union directly:
      ```python
      sensitive_fields = SENSITIVE_FIELDS.get(object_type, set()) | 
SENSITIVE_FIELDS.get("common", set())
      ```
   
   2. Use dict.get() with default empty set:
      ```python
      sensitive_fields = SENSITIVE_FIELDS.get(object_type, set()) | 
SENSITIVE_FIELDS.get("common", set())
      ```
   
   3. Use dict.setdefault() to ensure sets:
      ```python
      base = SENSITIVE_FIELDS.setdefault(object_type, set())
      common = SENSITIVE_FIELDS.setdefault("common", set())
      sensitive_fields = base | common
      ```
   
   Which approach do you prefer, or do you have another idea?



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