samredai commented on code in PR #5747:
URL: https://github.com/apache/iceberg/pull/5747#discussion_r972107765
##########
python/pyiceberg/io/pyarrow.py:
##########
@@ -165,6 +169,24 @@ def to_input_file(self) -> "PyArrowFile":
class PyArrowFileIO(FileIO):
+ def __init__(self, properties: Properties = EMPTY_DICT):
+ self.get_fs_and_path: Callable = lru_cache(self._get_fs_and_path)
+ super().__init__(properties=properties)
+
+ def _get_fs_and_path(self, location: str) -> Tuple[FileSystem, str]:
+ uri = urlparse(location) # Create a ParseResult from the URI
+ if not uri.scheme: # If no scheme, assume the path is to a local file
+ return FileSystem.from_uri(os.path.abspath(location))
+ elif uri.scheme in {"s3", "s3a", "s3n"}:
Review Comment:
Since the pyarrow [filesystem
interface](https://arrow.apache.org/docs/python/filesystems.html) support GCS
and HDFS, should we add more `elif` blocks here to generate either of those
filesystems?
--
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]