MCPcopy Create free account
hub / github.com/apache/arrow / test_filesystem_uri

Function test_filesystem_uri

python/pyarrow/tests/test_orc.py:238–259  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

236
237
238def test_filesystem_uri(tmpdir):
239 from pyarrow import orc
240 table = pa.table({"a": [1, 2, 3]})
241
242 directory = tmpdir / "data_dir"
243 directory.mkdir()
244 path = directory / "data.orc"
245 orc.write_table(table, str(path))
246
247 # filesystem object
248 result = orc.read_table(path, filesystem=fs.LocalFileSystem())
249 assert result.equals(table)
250
251 # filesystem URI
252 result = orc.read_table(
253 "data_dir/data.orc", filesystem=util._filesystem_uri(tmpdir))
254 assert result.equals(table)
255
256 # use the path only
257 result = orc.read_table(
258 util._filesystem_uri(path))
259 assert result.equals(table)
260
261
262def test_orcfile_readwrite(tmpdir):

Callers

nothing calls this directly

Calls 4

LocalFileSystemMethod · 0.80
equalsMethod · 0.80
write_tableMethod · 0.45
read_tableMethod · 0.45

Tested by

no test coverage detected