bito-code-review[bot] commented on PR #43577:
URL: https://github.com/apache/superset/pull/43577#issuecomment-5450412413

   <!-- Bito Reply -->
   The current implementation of `_ensure_list` treats an empty string `""` as 
a scalar value, wrapping it in a list as `[""]`. If the desired behavior is to 
treat an empty string as an empty collection (returning `[]`), `_ensure_list` 
should be updated to explicitly handle empty strings. 
   
   Currently, `_ensure_list` is defined as:
   
   ```python
   def _ensure_list(value: Any) -> list[Any]:
       if value is None:
           return []
       if isinstance(value, (list, tuple)):
           return list(value)
       return [value]
   ```
   
   To return `[]` for an empty string, you would add `if value == "": return 
[]` before the final return statement.
   
   **superset/security/manager.py**
   ```
   if value is None:
           return []
       if value == "":
           return []
       if isinstance(value, (list, tuple)):
           return list(value)
       return [value]
   ```


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