Skip to content

fix(io): pass S3 CA cert to PyArrow - #4019

Open
1fanwang wants to merge 2 commits into
apache:mainfrom
1fanwang:1fannnw/propagate-s3-ca-cert
Open

1fanwang wants to merge 2 commits into
apache:mainfrom
1fanwang:1fannnw/propagate-s3-ca-cert

Conversation

@1fanwang

Copy link
Copy Markdown

Closes #3866

Rationale for this change

The PyArrow FileIO path accepted s3.ssl.ca-cert in catalog properties, but it did not pass the value into PyArrow's S3 client. Users with private S3 endpoints or self signed certificates could still hit curlCode: 60 during PyArrow reads and writes.

This change maps the existing Iceberg property to PyArrow's TLS CA file argument for S3 and OSS filesystems. PyArrow added that argument in 21.0.0, so older PyArrow versions now fail fast only when the CA certificate property is set.

Are these changes tested?

Yes.

Raw logs

Before 545cb66:

$ uv run python -m pytest tests/io/test_pyarrow.py::test_pyarrow_s3_session_properties -v
FAILED [100%]
E Expected: S3FileSystem(..., tls_ca_file_path='/path/to/ca.pem')
E Actual:   S3FileSystem(..., region='us-east-1')
1 failed in 0.63s

After 545cb66:

$ uv run python -m pytest tests/io/test_pyarrow.py::test_pyarrow_s3_session_properties tests/io/test_pyarrow.py::test_pyarrow_s3_ssl_ca_cert_requires_supported_pyarrow_version -v
PASSED [ 50%]
PASSED [100%]
2 passed in 0.40s

Adjacent S3 property checks passed: 4 passed, 241 deselected in 1.54s.

Are there any user-facing changes?

Yes. s3.ssl.ca-cert now takes effect for PyArrow-backed S3 and OSS file operations when PyArrow is 21.0.0 or newer.

AI Disclosure

AI disclosure: GitHub Copilot CLI (Claude Opus 5.5) wrote this change and its tests, and an automated coordinator reviewed the diff and test output before submission.

Areas of uncertainty: none known.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
Copilot AI lite review requested due to automatic review settings September 25, 2026 06:15

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Critical runtime failure and an undeclared dependency must be fixed.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Adds support for forwarding s3.ssl.ca-cert to PyArrow S3/OSS filesystems, with PyArrow version validation.

Changes:

  • Defines the S3 CA certificate property.
  • Passes the CA path to PyArrow.
  • Adds propagation and compatibility tests.

Review blockers: the implementation references undefined pyarrow instead of pa, and uses an undeclared runtime packaging dependency.

File Description
tests/​io/​test_pyarrow.py Tests CA propagation and version requirements.
pyiceberg/​io/​pyarrow.py Adds TLS CA configuration and version checks.
pyiceberg/​io/​__init__.py Defines the CA certificate property.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pyiceberg/io/pyarrow.py Outdated
Comment on lines +462 to +466
if version.parse(pyarrow.__version__) < version.parse(min_pyarrow_version_supporting_tls_ca_file_path):
raise ImportError(
f"pyarrow version >= {min_pyarrow_version_supporting_tls_ca_file_path} required for "
f"S3FileSystem tls_ca_file_path support, but found version {pyarrow.__version__}."
)
Signed-off-by: 1fanwang <1fannnw@gmail.com>

This branch has not been deployed

No deployments
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.

[Bug] PyArrowFileIO fails to propagate s3.ssl.ca-cert to pyarrow.fs.S3FileSystem tls_ca_file_path

2 participants