Skip to content

[python] Propagate dependency read context in REST headers - #8908

Open
leaves12138 wants to merge 2 commits into
apache:masterfrom
leaves12138:python/read-via-header
Open

[python] Propagate dependency read context in REST headers#8908
leaves12138 wants to merge 2 commits into
apache:masterfrom
leaves12138:python/read-via-header

Conversation

@leaves12138

@leaves12138 leaves12138 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Purpose

Port the dependency read context propagation introduced by #8823 and the custom catalog preservation follow-up from #8912 to PyPaimon.

Changes

  • Add the optional X-Paimon-Read-Via REST header constant.
  • Derive a dependency-scoped REST catalog context from the outermost table.
  • Preserve the original source table across nested Blob View dependency reads.
  • Preserve explicitly configured custom REST metastore identifiers.
  • Reconstruct dependency catalogs through CatalogFactory with the full CatalogContext instead of forcing the built-in REST loader.
  • Reuse existing header.* propagation so dependency table and data-token requests carry the context.
  • Add focused tests for built-in REST, custom REST catalogs, external REST contexts, nested dependencies, non-REST catalogs, and Blob View loading.

The header is request context only and must not be treated as authorization proof.

Validation

  • PYTHONPATH=. python3 -m unittest pypaimon.tests.catalog_environment_test pypaimon.tests.rest.api_test pypaimon.tests.rest.rest_token_file_io_test -v (28 tests passed)
  • python3 -m compileall -q pypaimon/catalog/catalog_factory.py pypaimon/catalog/catalog_environment.py pypaimon/utils/blob_view_lookup.py pypaimon/tests/catalog_environment_test.py
  • flake8 --config=paimon-python/dev/cfg.ini paimon-python/pypaimon/catalog/catalog_factory.py paimon-python/pypaimon/catalog/catalog_environment.py paimon-python/pypaimon/utils/blob_view_lookup.py paimon-python/pypaimon/tests/catalog_environment_test.py
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant