Skip to content

Send the pyiceberg User-Agent on S3 remote signing requests - #4367

Merged
kevinjqliu merged 1 commit into
apache:mainfrom
rahulsmahadev:s3-signer-user-agent
Nov 13, 2026
Merged

kevinjqliu merged 1 commit into
apache:mainfrom
rahulsmahadev:s3-signer-user-agent

Conversation

@rahulsmahadev

Copy link
Copy Markdown
Contributor

Rationale for this change

S3V4RestSigner sends its signing requests to the REST catalog's signer endpoint from its own requests.Session(), without a User-Agent. Those calls show up as python-requests/<version> instead of the pyiceberg/<version> (<python implementation> <python version>) value that the catalog sends since #4330, following the REST spec's User-Agent recommendation (apache/iceberg#17727).

This moves the value into a small _user_agent() helper in pyiceberg.catalog.rest and sets it on signer requests the same way the catalog session does, after the header.* properties.

Are these changes tested?

Yes. test_s3v4_rest_signer now checks that the signing request carries the pyiceberg User-Agent. Without this change it fails, because the request sends python-requests/<version>.

Are there any user-facing changes?

S3 remote signing requests now send the pyiceberg User-Agent. As on the catalog session, a header.User-Agent property does not override it.

This pull request and its description were written by Isaac.

S3V4RestSigner posts to the REST catalog's signing endpoint from its own
requests session, so those calls went out as python-requests/<version>
instead of the pyiceberg User-Agent that the catalog sends. Share the
value through a small _user_agent() helper and set it on signer requests
the same way the catalog session does, after the header properties.

Co-authored-by: Isaac <no-reply@databricks.com>
@rahulsmahadev

Copy link
Copy Markdown
Contributor Author

A note on the last line of the description: Isaac is the internal agent harness I use at work, and Claude is the model.

@kevinjqliu kevinjqliu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

@kevinjqliu
kevinjqliu enabled auto-merge November 13, 2026 18:41
@kevinjqliu
kevinjqliu added this pull request to the merge queue Nov 13, 2026
Merged via the queue into apache:main with commit c971ff5 Nov 13, 2026
20 checks passed
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