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

Function s3_example_simple

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

Source from the content-addressed store, hash-verified

2923
2924@pytest.fixture
2925def s3_example_simple(s3_server):
2926 from pyarrow.fs import FileSystem
2927
2928 host, port, access_key, secret_key = s3_server['connection']
2929 uri = (
2930 f"s3://{access_key}:{secret_key}@mybucket/data.parquet?scheme=http"
2931 f"&endpoint_override={host}:{port}&allow_bucket_creation=True"
2932 )
2933
2934 fs, path = FileSystem.from_uri(uri)
2935
2936 fs.create_dir("mybucket")
2937 table = pa.table({'a': [1, 2, 3]})
2938 with fs.open_output_stream("mybucket/data.parquet") as out:
2939 pq.write_table(table, out)
2940
2941 return table, path, fs, uri, host, port, access_key, secret_key
2942
2943
2944@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