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

   <!-- Bito Reply -->
   The suggestion replaces direct dictionary access with .get() and checks for 
None, raising a descriptive ValueError instead of a bare KeyError. Applying it 
improves error handling and matches the pattern in hashing.py, making the code 
more robust and user-friendly.
   
   **superset/utils/cache_manager.py**
   ```
   algorithm = current_app.config["HASH_ALGORITHM"]
           hash_func = _HASH_METHODS.get(algorithm)
           if hash_func is None:
               raise ValueError(f"Unsupported hash algorithm: {algorithm}")
           return hash_func(data)
   ```


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