rok commented on code in PR #46330:
URL: https://github.com/apache/arrow/pull/46330#discussion_r3306035238
##########
python/pyarrow/parquet/core.py:
##########
@@ -1947,7 +1947,15 @@ def read_table(source, *, columns=None, use_threads=True,
)
source = filesystem.open_input_file(path)
-
+ if not (
+ (isinstance(source, str) and not os.path.isdir(source))
+ or isinstance(source, pa.NativeFile)
+ or hasattr(source, "read")
+ ):
+ raise ValueError(
+ "source should be a file name, a pyarrow.NativeFile or a
file-like "
+ "object when the pyarrow.dataset module is not available"
+ )
Review Comment:
It appears we had [merged a PR](https://github.com/apache/arrow/pull/48008)
that covered this issue in part.
https://github.com/apache/arrow/blob/63813b6a6f3d7c8353879bfc26c6f8a8458965ca/python/pyarrow/parquet/core.py#L1940-L1947
Can you see if your check can be consolidated with the existing one?
--
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]