-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-40353][PS][CONNECT] Fix index nullable mismatch in ps.read_excel
#50323
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
Conversation
ps.read_excelps.read_excel
| pd.read_excel(open(path1, "rb"), index_col=0), | ||
| ) | ||
| self.assert_eq( | ||
| ps.read_excel(open(path1, "rb"), index_col=0, squeeze=True), |
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.
squeeze is dropped at pandas 2.0, so we need to remove it
| self.assert_eq(psdfs["Sheet_name_1"], pdfs1["Sheet_name_1"]) | ||
| self.assert_eq(psdfs["Sheet_name_2"], pdfs1["Sheet_name_2"]) | ||
|
|
||
| psdfs = ps.read_excel(tmp, sheet_name=sheet_name, index_col=0, squeeze=True) |
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.
such tests make no sense since squeeze=True is not allowed any more
|
|
||
| psdf = cast(DataFrame, from_pandas(pdf)) | ||
| return_schema = force_decimal_precision_scale( | ||
| as_nullable_spark_type(psdf._internal.spark_frame.drop(*HIDDEN_COLUMNS).schema) |
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.
as_nullable_spark_type convert all fields (both index and data) to nullable=true, while in InternalFrame it assert the index field should have nullable=false
ps.read_excelps.read_excel
|
Merged to master. |
What changes were proposed in this pull request?
Fix nullable mismatch in
ps.read_excelWhy are the changes needed?
to re-enable the tests
Does this PR introduce any user-facing change?
no
How was this patch tested?
updated ut
Was this patch authored or co-authored using generative AI tooling?
no