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

Function gcsfs

python/pyarrow/tests/test_fs.py:212–238  ·  view source on GitHub ↗
(request, gcs_server)

Source from the content-addressed store, hash-verified

210
211@pytest.fixture
212def gcsfs(request, gcs_server):
213 request.config.pyarrow.requires('gcs')
214 from pyarrow.fs import GcsFileSystem
215
216 host, port = gcs_server['connection']
217 bucket = 'pyarrow-filesystem/'
218
219 fs = GcsFileSystem(
220 endpoint_override=f'{host}:{port}',
221 scheme='http',
222 # Mock endpoint doesn't check credentials.
223 anonymous=True,
224 retry_time_limit=timedelta(seconds=45),
225 project_id='test-project-id'
226 )
227 try:
228 fs.create_dir(bucket)
229 except OSError as e:
230 pytest.skip(f"Could not create directory in {fs}: {e}")
231
232 yield dict(
233 fs=fs,
234 pathfn=bucket.__add__,
235 allow_move_dir=False,
236 allow_append_to_file=False,
237 )
238 fs.delete_dir(bucket)
239
240
241@pytest.fixture

Callers

nothing calls this directly

Calls 4

GcsFileSystemClass · 0.90
requiresMethod · 0.80
create_dirMethod · 0.45
delete_dirMethod · 0.45

Tested by

no test coverage detected