You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/25 08:57:56 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #12231: ARROW-14783: [C++][Python] Fix the write ORC in BytesIO issue

pitrou commented on a change in pull request #12231:
URL: https://github.com/apache/arrow/pull/12231#discussion_r791487536



##########
File path: python/pyarrow/orc.py
##########
@@ -330,7 +330,9 @@ def read_table(source, columns=None, filesystem=None):
 """
 
 
-def write_table(table, where, *, file_version='0.12',
+def write_table(table, where, *,
+                close_file=False,

Review comment:
       We don't add this argument after all, do we?

##########
File path: python/pyarrow/tests/test_orc.py
##########
@@ -171,7 +171,26 @@ def test_orcfile_empty(datadir):
     assert table.schema == expected_schema
 
 
-def test_readwrite(tmpdir):
+def test_filesystem_uri(tmpdir):
+    from pyarrow import orc
+    table = pa.table({"a": [1, 2, 3]})
+
+    directory = tmpdir / "data_dir"
+    directory.mkdir()
+    path = directory / "data.orc"
+    orc.write_table(table, str(path))
+
+    # filesystem object
+    result = orc.read_table(path, filesystem=fs.LocalFileSystem())
+    assert result.equals(table)
+
+    # filesystem URI
+    result = orc.read_table(
+        "data_dir/data.orc", filesystem=util._filesystem_uri(tmpdir))

Review comment:
       Is it also possible to do `orc.read_table(util._filesystem_uri(path))`?




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org