Spenserrrr commented on code in PR #58073:
URL: https://github.com/apache/spark/pull/58073#discussion_r3817324723
##########
python/pyspark/testing/goldenutils.py:
##########
@@ -371,17 +385,25 @@ def repr_arrow_table_value(cls, value: Any, max_len: int
= 32) -> str:
str
"{col: [val1, val2, None], ...}@Table[name: type, ...]"
"""
- columns = []
- for name, column in zip(value.column_names, value.columns):
- # Escape NULL bytes so the value can be safely stored in CSV files.
- elements = [cls._scalar_str(scalar) for scalar in column]
- columns.append(f"{name}: [" + ", ".join(elements) + "]")
- v_str = "{" + ", ".join(columns) + "}"
- if max_len > 0:
- v_str = v_str[:max_len]
- schema = ", ".join(f"{f.name}: {cls.repr_type(f.type)}" for f in
value.schema)
+ v_str, schema = cls._repr_arrow_columns(value, max_len)
return f"{v_str}@Table[{schema}]"
+ @classmethod
+ def repr_arrow_record_batch_value(cls, value: Any, max_len: int = 32) ->
str:
Review Comment:
Yeah, that is a good call. I just fixed the type annotation for other repr
methods as well.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]