Skip to content

feat: Add REST loadCredentials support#3499

Open
kevinjqliu wants to merge 1 commit into
mainfrom
codex/load-credentials-api
Open

feat: Add REST loadCredentials support#3499
kevinjqliu wants to merge 1 commit into
mainfrom
codex/load-credentials-api

Conversation

@kevinjqliu

@kevinjqliu kevinjqliu commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add REST loadCredentials endpoint support
  • parse LoadCredentialsResponse
  • expose RestCatalog.load_credentials(...) with longest-prefix resolution for a target location

Contributes to #3495.

Notes

The pinned apache/iceberg-rest-fixture:1.10.1 used by integration tests does not serve the /credentials route, so this is covered with REST catalog unit tests rather than fixture-backed integration tests.

Testing

  • PYTHONPATH=. pytest tests/catalog/test_rest.py -k 'load_credentials or storage_credentials'
  • ruff check pyiceberg/catalog/rest/__init__.py tests/catalog/test_rest.py
  • ruff format --check pyiceberg/catalog/rest/__init__.py tests/catalog/test_rest.py

@kevinjqliu kevinjqliu force-pushed the codex/load-credentials-api branch from 9cb70c8 to 69a6e5b Compare June 13, 2026 21:07
@kevinjqliu kevinjqliu force-pushed the codex/load-credentials-api branch from 69a6e5b to 64d39b6 Compare June 13, 2026 21:11
@kevinjqliu kevinjqliu changed the title [codex] Add REST loadCredentials support feat: Add REST loadCredentials support Jun 13, 2026
@kevinjqliu kevinjqliu marked this pull request as ready for review June 13, 2026 21:22

return ScanTasks.model_validate_json(response.text)

@retry(**_RETRY_ARGS)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: These methods are added between _fetch_scan_tasks and plan_scan. These two methods are closely related. How about relocating these new methods to different locations?

Comment on lines +561 to +562
response = self._session.get(
self.url(Endpoints.load_credentials, prefixed=True, **self._split_identifier_for_path(identifier)),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming we'll support optional parameters as a follow-up if necessary:

      parameters:
        - name: planId
          in: query
          required: false
          schema:
            type: string
          description: The plan ID that has been used for server-side scan planning
        - $ref: '#/components/parameters/referenced-by'

https://github.com/apache/iceberg/blob/51ee2cc0d993fe58de21b76613f350da97e9d3ef/open-api/rest-catalog-open-api.yaml#L1363-L1370

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.

2 participants