-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Write compliant Parquet with pyarrow
#43690
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
Changes from 4 commits
e3f1687
39010eb
cc7e6a8
17b4d17
5f06acd
4025014
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 |
---|---|---|
|
@@ -931,6 +931,17 @@ def test_read_parquet_manager(self, pa, using_array_manager): | |
else: | ||
assert isinstance(result._mgr, pd.core.internals.BlockManager) | ||
|
||
@td.skip_if_no("pyarrow", min_version="4.0.0") | ||
def test_list_column_results_in_compliant_parquet(self, pa): | ||
# https://github.com/pandas-dev/pandas/issues/43689 | ||
df = pd.DataFrame({"a": [[1], [2]]}) | ||
|
||
with tm.ensure_clean() as path: | ||
df.to_parquet(path, pa) | ||
result = pyarrow.parquet.read_table(path) | ||
|
||
assert str(result.schema.field_by_name("a").type) == "list<element: int64>" | ||
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. use 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. That isn't what I'm testing though... I'm testing that the Parquet that is written is correct... ie. "list<element: int64>" not "list<item: int64>" The serializer and deserializer always worked. 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. 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. 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. well if the serialize & de-serialize works then i am not sure i understand the problem. you can certainly assert the meta-data if you want. the most important point is that you need this option to have correct results yes? 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. The problem is that What if I want to load data from Pandas into a different language? 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. Here is an example of a place where this is an issue: googleapis/python-bigquery#980 Really 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. In summary: yes, But then that comes back around to changing output format and so my point about calling users attention to that in What's New. It they're using the data elsewhere (not Pandas) it could cause them problems. |
||
|
||
|
||
class TestParquetFastParquet(Base): | ||
def test_basic(self, fp, df_full): | ||
|
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.
you don't need to add a whole sub-section on this. a single line note is fine.
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.
I just figured that since it could break people's stuff it was worth calling out but shall remove if you'd prefer?
Let me know.
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.
the entire point is this wont' break anyone, yes just a single entry is fine
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.
Do you want to expand on this? This change will change the data that Pandas outputs. If a user is expecting and handling the current output (not necessarily back into Pandas as Parquet is a cross platform format) then this could break their code elsewhere?
Am I misunderstanding your point?
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.
just a single line is fine here