-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jay Chia
committed
Jul 3, 2024
1 parent
492a521
commit 83178b1
Showing
2 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from __future__ import annotations | ||
|
||
import pytest | ||
|
||
import daft | ||
|
||
from .conftest import minio_create_bucket | ||
|
||
|
||
@pytest.mark.integration() | ||
def test_files_roundtrip_minio_native_downloader(minio_io_config): | ||
bucket_name = "my-bucket" | ||
folder = f"s3://{bucket_name}/my-folder" | ||
with minio_create_bucket(minio_io_config=minio_io_config, bucket_name=bucket_name): | ||
bytes_data = [b"a", b"b", b"c"] | ||
data = {"data": bytes_data} | ||
df = daft.from_pydict(data) | ||
df = df.with_column("file_paths", df["data"].bytes.upload_to_folder(folder, io_config=minio_io_config)) | ||
df.collect() | ||
|
||
df = df.with_column("roundtrip_data", df["file_paths"].url.download(io_config=minio_io_config)) | ||
results = df.to_pydict() | ||
|
||
assert results["data"] == results["roundtrip_data"] == bytes_data | ||
for path, expected in zip(results["file_paths"], bytes_data): | ||
assert path.startswith(folder) |
This file was deleted.
Oops, something went wrong.