tbcs commented on issue #20503: [SPARK-23299][SQL][PYSPARK] Fix __repr__ behaviour for Rows. URL: https://github.com/apache/spark/pull/20503#issuecomment-484227145 Bye the way, this is not just an annoyance for interactive use, I bumped into this issue while trying to understand failing tests (run via pytest). Having a broken `__repr__` is rather annoying in such a situation. output for a failing test with broken `__repr__`: ``` E assert [<Row(foo)>] == [<[TypeError("sequence ...ect at 0x7fa1d24a4240>] E (pytest_assertion plugin: representation of details failed. Probably an object has a faulty __repr__.) E /home/user/projects/foobar/venv/lib/python3.6/site-packages/pyspark/sql/types.py:1552: TypeError: sequence item 0: expected str instance, NoneType found ``` output for a failing test with fixed `__repr__`: ``` E assert [<Row(foo)>] == [<Row(None)>] E At index 0 diff: <Row(foo)> != <Row(None)> E Full diff: E - [<Row(foo)>] E ? ^ ^ E + [<Row(None)>] E ? ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
