eschutho opened a new pull request, #34768:
URL: https://github.com/apache/superset/pull/34768

   ### SUMMARY
   This PR improves error handling in the DAO layer by catching SQLAlchemy 
errors in the `find_by_ids` method and raising a more descriptive 
`DAOFindFailedError` with context about which model and IDs failed.
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A - Backend error handling change
   ### TESTING INSTRUCTIONS
   1. Run the new unit tests: `pytest tests/unit_tests/dao/base_dao_test.py`
   2. Test that the error message includes model name and IDs when a database 
error occurs during find operations
   3. Verify that normal operations continue to work as expected
   ### ADDITIONAL INFORMATION
   - Added new DAO exception classes (`DAOFindFailedError`, 
`DAOCreateFailedError`, `DAOUpdateFailedError`, `DAODeleteFailedError`) for 
better error categorization
   - Added comprehensive unit tests covering error scenarios and edge cases
   - Includes a guard clause to return early when `model_ids` is empty, 
avoiding unnecessary database queries
   - Provides clearer error messages that include the model name and the IDs 
that failed, making debugging easier
   ### CHECKLIST
   - [] Has associated issue: 
   - [] Required feature flags: 
   - [] Changes UI: 
   - [] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [] Introduces new feature or API
   - [] Removes existing feature or API


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