kosiew commented on code in PR #1367:
URL:
https://github.com/apache/datafusion-python/pull/1367#discussion_r2767383234
##########
python/datafusion/dataframe_formatter.py:
##########
@@ -231,6 +317,55 @@ def __init__(
self._custom_cell_builder: Callable[[Any, int, int, str], str] | None
= None
self._custom_header_builder: Callable[[Any], str] | None = None
+ @property
+ def max_rows(self) -> int:
+ """Get the maximum number of rows to display.
+
+ Returns:
+ The maximum number of rows to display in repr output
+ """
+ return self._max_rows
+
+ @max_rows.setter
+ def max_rows(self, value: int) -> None:
+ """Set the maximum number of rows to display.
+
+ Args:
+ value: The maximum number of rows
+ """
+ self._max_rows = value
+
+ @property
Review Comment:
I added the accessors for **backward compatibility** during the deprecation
period:
Rationale:
1. User code may directly access the property: Code like
`formatter.repr_rows = 20` continue working during the deprecation period
2. Graceful migration path: Users get a warning but their code doesn't break
3. Custom formatter implementations: External code that inherits from the
formatter and accesses `repr_rows` directly will continue to work
Shall we keep the accessors for now with the deprecation warnings, plan
removal in next major version?
--
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]