-
-
Notifications
You must be signed in to change notification settings - Fork 20k
TST: Add test for writing UUIDs to parquet with pyarrow #61602 #65647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
3bbeea2
88d4e28
9d98157
5f4d739
b2f9c8b
72dc35a
c53e34c
6b7b57f
1f36ae7
e699965
f4f3e4e
91f481c
6332052
8925886
0139402
9053a75
bdd3ae3
b244666
764647b
9fe4745
07ccaef
8733d2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |
| from io import BytesIO | ||
| import os | ||
| import pathlib | ||
| import uuid | ||
|
|
||
| import numpy as np | ||
| import pytest | ||
|
|
@@ -1521,3 +1522,18 @@ def test_invalid_dtype_backend(self, engine, temp_file): | |
| df.to_parquet(temp_file) | ||
| with pytest.raises(ValueError, match=msg): | ||
| read_parquet(temp_file, dtype_backend="numpy") | ||
|
|
||
|
|
||
| def test_to_parquet_uuid_supported(tmp_path): | ||
| # GH 61602 | ||
| pytest.importorskip("pyarrow", minversion="24.0.0") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Skips should be done on test collection, not test execution, where ever possible. Use instead. |
||
|
|
||
| df = pd.DataFrame({"id": [uuid.uuid4(), uuid.uuid4()]}) | ||
| path = tmp_path / "test_uuid.parquet" | ||
|
|
||
| # This should not raise an error | ||
| df.to_parquet(path, engine="pyarrow") | ||
|
|
||
| # Verify it can be read back | ||
| result = read_parquet(path, engine="pyarrow") | ||
| assert len(result) == 2 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you test the full result. I think the following would work. tm.assert_frame_equal(result, df) |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use
temp_fileinstead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mroeschke Done! Swapped tmp_path for the temp_file fixture. Thanks for the review!!