(s3_example_simple)
| 2975 | @pytest.mark.parquet |
| 2976 | @pytest.mark.s3 # still needed to create the data |
| 2977 | def test_open_dataset_from_uri_s3_fsspec(s3_example_simple): |
| 2978 | table, path, _, _, host, port, access_key, secret_key = s3_example_simple |
| 2979 | s3fs = pytest.importorskip("s3fs") |
| 2980 | |
| 2981 | from pyarrow.fs import FSSpecHandler, PyFileSystem |
| 2982 | |
| 2983 | fs = s3fs.S3FileSystem( |
| 2984 | key=access_key, |
| 2985 | secret=secret_key, |
| 2986 | client_kwargs={ |
| 2987 | 'endpoint_url': f'http://{host}:{port}' |
| 2988 | } |
| 2989 | ) |
| 2990 | |
| 2991 | # passing as fsspec filesystem |
| 2992 | dataset = ds.dataset(path, format="parquet", filesystem=fs) |
| 2993 | assert dataset.to_table().equals(table) |
| 2994 | |
| 2995 | # directly passing the fsspec-handler |
| 2996 | fs = PyFileSystem(FSSpecHandler(fs)) |
| 2997 | dataset = ds.dataset(path, format="parquet", filesystem=fs) |
| 2998 | assert dataset.to_table().equals(table) |
| 2999 | |
| 3000 | |
| 3001 | @pytest.mark.parquet |
nothing calls this directly
no test coverage detected