[SPARK-44643][SQL][PYTHON] Fix Row.__repr__ for the case the field is empty Row#42303
Closed
ueshin wants to merge 2 commits intoapache:masterfrom
Closed
[SPARK-44643][SQL][PYTHON] Fix Row.__repr__ for the case the field is empty Row#42303ueshin wants to merge 2 commits intoapache:masterfrom
ueshin wants to merge 2 commits intoapache:masterfrom
Conversation
Member
Author
HyukjinKwon
approved these changes
Aug 2, 2023
allisonwang-db
approved these changes
Aug 3, 2023
zhengruifeng
approved these changes
Aug 3, 2023
Member
|
Merged to master and branch-3.5. |
HyukjinKwon
pushed a commit
that referenced
this pull request
Aug 3, 2023
… empty Row ### What changes were proposed in this pull request? Fix `Row.__repr__` for the case the field is empty `Row`. ```py >>> repr(Row(Row())) '<Row(<Row()>)>' ``` ### Why are the changes needed? `Row.__repr__` is broken when it contains an empty `Row`: ```py >>> repr(Row(Row())) Traceback (most recent call last): ... TypeError: not enough arguments for format string ``` ### Does this PR introduce _any_ user-facing change? `Row` that contains an empty `Row` will be shown in the REPL. ### How was this patch tested? Added the related test. Closes #42303 from ueshin/issues/SPARK-44643/repr_row. Authored-by: Takuya UESHIN <ueshin@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org> (cherry picked from commit 8a84718) Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Fix
Row.__repr__for the case the field is emptyRow.Why are the changes needed?
Row.__repr__is broken when it contains an emptyRow:Does this PR introduce any user-facing change?
Rowthat contains an emptyRowwill be shown in the REPL.How was this patch tested?
Added the related test.