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

Function test_fsspec_filesystem_from_uri

python/pyarrow/tests/test_fs.py:2220–2237  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2218
2219
2220def test_fsspec_filesystem_from_uri():
2221 try:
2222 from fsspec.implementations.local import LocalFileSystem
2223 from fsspec.implementations.memory import MemoryFileSystem
2224 except ImportError:
2225 pytest.skip("fsspec not installed")
2226
2227 fs, path = FileSystem.from_uri("fsspec+memory://path/to/data.parquet")
2228 expected_fs = PyFileSystem(FSSpecHandler(MemoryFileSystem()))
2229 assert fs == expected_fs
2230 assert path == "/path/to/data.parquet"
2231
2232 # check that if fsspec+ is specified than we don't coerce to the native
2233 # arrow local filesystem
2234 uri = "file:///tmp/my.file"
2235 fs, _ = FileSystem.from_uri(f"fsspec+{uri}")
2236 expected_fs = PyFileSystem(FSSpecHandler(LocalFileSystem()))
2237 assert fs == expected_fs
2238
2239
2240def test_fsspec_delete_root_dir_contents():

Callers

nothing calls this directly

Calls 2

FSSpecHandlerClass · 0.90
LocalFileSystemClass · 0.85

Tested by

no test coverage detected