1yangsh opened a new pull request, #4465: URL: https://github.com/apache/iceberg-python/pull/4465
# Rationale for this change `RestCatalog.commit_table` documents `NoSuchTableError` for a missing table, but a 404 was not in its error map, so it surfaced as a generic `RESTError`. A 503 raised `ServiceUnavailableError`. Java's `ErrorHandlers.CommitErrorHandler` treats 500, 502, 503 and 504 as `CommitStateUnknownException`, since the server may have applied the commit. 503 was added there in apache/iceberg#13619. This change maps 404 to `NoSuchTableError` and 503 to `CommitStateUnknownException`, matching Java. ## Are these changes tested? Yes. `test_commit_table_error_mapping` in `tests/catalog/test_rest.py` checks the exception raised for 404, 409, 500, 502, 503 and 504. ## Are there any user-facing changes? Yes: - A 404 on commit now raises `NoSuchTableError` instead of `RESTError`. - A 503 on commit now raises `CommitStateUnknownException` instead of `ServiceUnavailableError`. AI disclosure: an AI coding assistant helped draft the change and the tests. The mapping was checked against Java's `ErrorHandlers`, and the catalog tests and linters were run before submitting. -- 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]
