joshuarobinson commented on code in PR #5747:
URL: https://github.com/apache/iceberg/pull/5747#discussion_r969432045
##########
python/pyiceberg/io/pyarrow.py:
##########
@@ -164,7 +163,27 @@ def to_input_file(self) -> "PyArrowFile":
return self
+
class PyArrowFileIO(FileIO):
+
+ def __init__(self, properties: Properties = {}):
+ 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) -> (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:
Does this change the "contains" to check in a set instead of list? naively,
I'd assume the list is cheaper to construct and search for small numbers of
elements, but I'd be curious to better understand why this change?
--
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]