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