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

Function s3_example_simple

python/pyarrow/tests/test_dataset.py:2931–2947  ·  view source on GitHub ↗
(s3_server)

Source from the content-addressed store, hash-verified

2929
2930@pytest.fixture
2931def s3_example_simple(s3_server):
2932 from pyarrow.fs import FileSystem
2933
2934 host, port, access_key, secret_key = s3_server['connection']
2935 uri = (
2936 f"s3://{access_key}:{secret_key}@mybucket/data.parquet?scheme=http"
2937 f"&endpoint_override={host}:{port}&allow_bucket_creation=True"
2938 )
2939
2940 fs, path = FileSystem.from_uri(uri)
2941
2942 fs.create_dir("mybucket")
2943 table = pa.table({'a': [1, 2, 3]})
2944 with fs.open_output_stream("mybucket/data.parquet") as out:
2945 pq.write_table(table, out)
2946
2947 return table, path, fs, uri, host, port, access_key, secret_key
2948
2949
2950@pytest.mark.parquet

Callers

nothing calls this directly

Calls 3

create_dirMethod · 0.45
open_output_streamMethod · 0.45
write_tableMethod · 0.45

Tested by

no test coverage detected