Repository navigation
Respect REST endpoint capabilities when checking view existence - #4337
Merged
Fokko merged 6 commits intoNov 11, 2026
Merged
Conversation
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Fokko
reviewed
Nov 11, 2026
Fokko
left a comment
Contributor
There was a problem hiding this comment.
Nice follow-up on #3960! The fallback mirrors table_exists() exactly, which keeps the two consistent.
A few observations:
-
Duplicate fallback logic:
table_exists()andview_exists()now have the same try/except-load pattern. Worth extracting a small_exists_via_load(load_fn, identifier)helper, but fine as a follow-up. -
Exception scope: the fallback catches
NoSuchViewError, butload_viewcan also raise for transient failures (5xx mapped toServiceUnavailableError). Those propagate, which is correct behavior forexistschecks, just noting it is intentional. -
Tests cover advertised-GET, legacy-server (via
view-endpoints-supported), and 404 paths. Good coverage.
Leaving as a comment review, not blocking.
Fokko
approved these changes
Nov 11, 2026
krishan711
added a commit
to krishan711/iceberg-python
that referenced
this pull request
Nov 12, 2026
…of-structs * upstream/main: (78 commits) fix(io): keep null lists of structs when projecting Arrow data (apache#4065) Skip unknown nested fields when resolving Avro read schemas (apache#4289) fix(expressions): reject non-finite floats on conversion to Decimal (apache#4287) fix: handle negative-scale Decimals in increment, decrement and truncate_decimal (apache#4285) Match NaN partition values with `IsNaN` in partition predicates (apache#4281) Fix append when a data column is named like a partition helper column (apache#4344) Widen decimal literal precision in scan filters (apache#4348) Add row-lineage support with Spark tests (apache#3972) Serialize purgeRequested as a lowercase boolean in REST drop_table (apache#4341) Validate each branch against its own commits on retry (apache#4317) Core: Compare upsert rows column by column instead of cell by cell (apache#4334) Core: Write added files under the partition spec they were planned with (apache#4338) Core: Check whether a failed last commit attempt landed before cleanup (apache#4339) REST: Use the standard User-Agent format (apache#4330) SQL: Accept an existing SQLAlchemy engine in SqlCatalog (apache#4336) Expose catalog labels on Table (apache#4321) Respect REST endpoint capabilities when checking view existence (apache#4337) Reject existing ref names in create_branch and create_tag (apache#4319) Assert every ref a transaction writes, not just the first (apache#4315) feat: send Idempotency-Key on REST mutations when the server advertises it (apache#4310) ... # Conflicts: # pyiceberg/io/pyarrow.py # tests/io/test_pyarrow.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Make
RestCatalog.view_exists()fall back toload_view()when the server does not advertise the view HEAD endpoint, following the existingRestCatalog.table_exists()fallback and namespace existence checks. Preserve advertised HEAD behavior and existing capability defaults.Are these changes tested?
Added separate regressions for advertised GET support, legacy servers with view support enabled, and missing views. The focused REST/view suite passes: 44 tests. Ruff, mypy, and applicable commit hooks pass.
Are there any user-facing changes?
view_exists()works with GET-capable servers that do not advertise HEAD. Missing views returnFalse; other load errors propagate.