samredai commented on a change in pull request #4021:
URL: https://github.com/apache/iceberg/pull/4021#discussion_r798141568
##########
File path: python/src/iceberg/io/base.py
##########
@@ -24,7 +24,40 @@
"""
from abc import ABC, abstractmethod
-from typing import Union
+from typing import Protocol, Union, runtime_checkable
+
+
+@runtime_checkable
+class InputStream(Protocol):
+ def read(self, n: int) -> bytes:
+ ...
Review comment:
Ah I see.
[This](https://arrow.apache.org/docs/python/parquet.html#reading-and-writing-single-files)
section of the pyarrow docs suggests that an instance of
[pyarrow.NativeFile](https://arrow.apache.org/docs/python/generated/pyarrow.NativeFile.html#pyarrow.NativeFile)
will provide the best performance and can be provided directly to
`pyarrow.parquet.read_table`. It has many more methods but includes the methods
defined in both protocols here so it would be implicitly considered a subtype
of both.
--
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]