Copilot commented on code in PR #4019:
URL: https://github.com/apache/iceberg-python/pull/4019#discussion_r4101720875
##########
pyiceberg/io/pyarrow.py:
##########
@@ -453,6 +454,18 @@ def _initialize_fs(self, scheme: str, netloc: str | None =
None) -> FileSystem:
else:
raise ValueError(f"Unrecognized filesystem type in URI: {scheme}")
+ def _set_tls_ca_file_path(self, client_kwargs: dict[str, Any]) -> None:
+ if tls_ca_file_path := self.properties.get(S3_SSL_CA_CERT):
+ from packaging import version
+
+ min_pyarrow_version_supporting_tls_ca_file_path = "21.0.0"
+ 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__}."
+ )
Review Comment:
`pyiceberg.io.pyarrow` imports the library as `pa` (line 55), so `pyarrow`
is undefined here. Any S3/OSS filesystem initialized with `s3.ssl.ca-cert` will
raise `NameError` before constructing `S3FileSystem`; the new version-gating
test also targets this nonexistent module attribute. Use the existing
`pa.__version__` alias consistently in the implementation and test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]