-
Notifications
You must be signed in to change notification settings - Fork 4.1k
GH-48254: [Python][Parquet] Support extension types in read_schema #48255
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 all commits
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 |
|---|---|---|
|
|
@@ -814,3 +814,22 @@ def msg(c): | |
|
|
||
| with pytest.raises(TypeError, match=msg("FileMetaData")): | ||
| pq.FileMetaData() | ||
|
|
||
|
|
||
| def test_read_schema_uuid_extension_type(tmp_path): | ||
| data = [ | ||
| b'\xe4`\xf9p\x83QGN\xac\x7f\xa4g>K\xa8\xcb', | ||
| b'\x1et\x14\x95\xee\xd5C\xea\x9b\xd7s\xdc\x91BK\xaf', | ||
|
Comment on lines
+820
to
+822
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. nit: can we add a comment on what is this / how was it generated?
Author
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. thoses are two uuid, i'll add comments |
||
| None, | ||
| ] | ||
| table = pa.table([pa.array(data, type=pa.uuid())], names=["ext"]) | ||
|
|
||
| file_path = tmp_path / "uuid.parquet" | ||
| file_path_str = str(file_path) | ||
| pq.write_table(table, file_path_str, store_schema=False) | ||
|
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. just curious, is
Author
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. it was 6 months ago so I'm only guessing now: I can confirm it if you want |
||
|
|
||
| schema_default = pq.read_schema(file_path_str) | ||
| assert schema_default.field("ext").type == pa.uuid() | ||
|
|
||
| schema_disabled = pq.read_schema(file_path_str, arrow_extensions_enabled=False) | ||
| assert schema_disabled.field("ext").type == pa.binary(16) | ||
Uh oh!
There was an error while loading. Please reload this page.