-
Notifications
You must be signed in to change notification settings - Fork 915
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
[REVIEW] Update orc reader and writer fuzz tests #7357
[REVIEW] Update orc reader and writer fuzz tests #7357
Conversation
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.
LGTM, but it's kind of hard to understand why some changes were made (without the detailed description).
@@ -67,6 +67,19 @@ def generate_input(self): | |||
dtypes_meta, num_rows, num_cols = _generate_rand_meta( | |||
self, dtypes_list | |||
) | |||
if num_cols == 0: | |||
""" | |||
If a dataframe has no columns, then pyorc writer will throw |
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 wondered what the desired behavior is here, i.e. whether ORC as a format supports having no columns.
I think we also have some issues writing empty dataframes to ORC.
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 guess we need to write an empty struct
. With pyorc we can do it this way:
>>> import pyorc
>>> import pandas as pd
>>> output = open("sample.orc", "wb")
>>> writer = pyorc.Writer(output, pyorc.Struct())
>>> writer.close()
>>> pd.read_orc('sample.orc')
Empty DataFrame
Columns: []
Index: []
Looks like I also need to make some code-changes in this PR. I'll update this PR.
Updated the code-changes with comments, this is ready for a re-review. |
Codecov Report
@@ Coverage Diff @@
## branch-0.19 #7357 +/- ##
==============================================
Coverage ? 82.21%
==============================================
Files ? 100
Lines ? 16971
Branches ? 0
==============================================
Hits ? 13953
Misses ? 3018
Partials ? 0 Continue to review full report at Codecov.
|
Co-authored-by: Ram (Ramakrishna Prabhu) <[email protected]>
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.
found a typo, LGTM otherwise
Co-authored-by: Vukasin Milovanovic <[email protected]>
@gpucibot merge |
This PR introduces:
pyorc
in usingpyorc.Struct
.list
dtype parameter changes introduced previously.