dennismdejong opened a new pull request, #13672:
URL: https://github.com/apache/gravitino/pull/13672

   ### What changes were proposed in this pull request?
   
   Introduce a `CodeMappingErrorHandler` base class in `rest_error_handler.py` 
that maps error codes to exception classes (or exception-type dictionaries) and 
delegates unmapped codes to the generic REST error mapping.
   
   Convert the 19 specialized error handlers (catalog, credential, fileset, 
function, group, job, metalake, model, owner, partition, permission, role, 
schema, secret, statistics, table, tag, user, view) to declare a 
`_code_exception_map` instead of duplicating the same `if/elif raise` branches.
   
   ### Why are the changes needed?
   
   This removes ~300 lines of duplicated code and reduces the `duplicate-code` 
Pylint violations from 277 to 259. Behavior is preserved: all error-handler 
unit tests pass.
   
   Fix: #3767
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   ```bash
   ./gradlew clients:client-python:pylint
   ./gradlew clients:client-python:test -PskipITs
   ```


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

Reply via email to