AlenkaF commented on code in PR #48008:
URL: https://github.com/apache/arrow/pull/48008#discussion_r2493374905


##########
python/pyarrow/parquet/core.py:
##########
@@ -1887,10 +1887,23 @@ def read_table(source, *, columns=None, 
use_threads=True,
                 "the 'schema' argument is not supported when the "
                 "pyarrow.dataset module is not available"
             )
+        if isinstance(source, list):
+            raise ValueError(
+                "the 'source' argument cannot be a list of files "
+                "when the pyarrow.dataset module is not available"

Review Comment:
   ```suggestion
                   "The 'source' argument cannot be a list of files "
                   "when the `pyarrow.dataset` module is not available."
   ```



##########
python/pyarrow/parquet/core.py:
##########
@@ -1887,10 +1887,23 @@ def read_table(source, *, columns=None, 
use_threads=True,
                 "the 'schema' argument is not supported when the "
                 "pyarrow.dataset module is not available"
             )
+        if isinstance(source, list):
+            raise ValueError(
+                "the 'source' argument cannot be a list of files "
+                "when the pyarrow.dataset module is not available"
+            )
+
         filesystem, path = _resolve_filesystem_and_path(source, filesystem)
         if filesystem is not None:
+            if not filesystem.get_file_info(path).is_file:
+                raise ValueError(
+                    "the 'source' argument should be "
+                    "an existing .parquet file and not a directory, "
+                    "when the pyarrow.dataset module is not available"

Review Comment:
   ```suggestion
                       "The 'source' argument should be "
                       "an existing parquet file and not a directory,"
                       "when the `pyarrow.dataset` module is not available."
   ```



##########
python/pyarrow/tests/parquet/test_basic.py:
##########
@@ -993,3 +993,14 @@ def test_checksum_write_to_dataset(tempdir):
     # checksum verification enabled raises an exception
     with pytest.raises(OSError, match="CRC checksum verification"):
         _ = pq.read_table(corrupted_file_path, page_checksum_verification=True)
+
+
[email protected](
+    "source", ["/tmp/", ["/tmp/file1.parquet", "/tmp/file2.parquet"]])
+def test_read_table_raises_value_error_when_ds_is_unavailable(
+        monkeypatch, source):

Review Comment:
   ```suggestion
   def test_read_table_raises_value_error_when_ds_is_unavailable(monkeypatch, 
source):
   ```



-- 
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]

Reply via email to