Commit c84017d
authored
fix: raise precise exception in rest_catalog list_namespaces (apache#1977)
<!--
Thanks for opening a pull request!
-->
<!-- In the case this PR will resolve an issue, please replace
${GITHUB_ISSUE_ID} below with the actual Github issue id. -->
<!-- Closes #${GITHUB_ISSUE_ID} -->
# Rationale for this change
`list_namespaces` should raise a `NoSuchNamespaceException` instead of a
generic `RestException` in case of a 404 response.
https://github.com/apache/iceberg/blob/main/open-api/rest-catalog-open-api.yaml#L279-L287
Also this is in line with the Java implementation of
[NamespaceErrorHandler](https://github.com/apache/iceberg/blob/9fb80b7167e58a2daef80f4a1a09f223b870c030/core/src/main/java/org/apache/iceberg/rest/ErrorHandlers.java#L182)
used by
`[listNamespaces()](https://github.com/apache/iceberg/blob/9fb80b7167e58a2daef80f4a1a09f223b870c030/core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java#L584)`
# Are these changes tested?
I added a unit test for it
# Are there any user-facing changes?
<!-- In the case of user-facing changes, please add the changelog label.
-->1 parent 23143e8 commit c84017d
File tree
2 files changed
+19
-1
lines changed- pyiceberg/catalog/rest
- tests/catalog
2 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
819 | | - | |
| 819 | + | |
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
558 | 576 | | |
559 | 577 | | |
560 | 578 | | |
| |||
0 commit comments