@@ -79,6 +79,75 @@ class TableProviderExportable(Protocol):
7979 def __datafusion_table_provider__ (self ) -> object : ... # noqa: D105
8080
8181
82+ class DataframeDisplayConfig :
83+ """Configuration for displaying DataFrame results.
84+
85+ This class allows you to control how DataFrames are displayed in Python.
86+ """
87+
88+ def __init__ (
89+ self ,
90+ max_table_bytes : int = None ,
91+ min_table_rows : int = None ,
92+ max_cell_length : int = None ,
93+ max_table_rows_in_repr : int = None ,
94+ ) -> None :
95+ """Create a new :py:class:`DataframeDisplayConfig` instance.
96+
97+ Args:
98+ max_table_bytes: Maximum bytes to display for table presentation (default: 2MB)
99+ min_table_rows: Minimum number of table rows to display (default: 20)
100+ max_cell_length: Maximum length of a cell before it gets minimized (default: 25)
101+ max_table_rows_in_repr: Maximum number of rows to display in repr string output (default: 10)
102+ """
103+ self .config_internal = DataframeDisplayConfigInternal (
104+ max_table_bytes = max_table_bytes ,
105+ min_table_rows = min_table_rows ,
106+ max_cell_length = max_cell_length ,
107+ max_table_rows_in_repr = max_table_rows_in_repr ,
108+ )
109+
110+ @property
111+ def max_table_bytes (self ) -> int :
112+ """Get the maximum bytes to display for table presentation."""
113+ return self .config_internal .max_table_bytes
114+
115+ @max_table_bytes .setter
116+ def max_table_bytes (self , value : int ) -> None :
117+ """Set the maximum bytes to display for table presentation."""
118+ self .config_internal .max_table_bytes = value
119+
120+ @property
121+ def min_table_rows (self ) -> int :
122+ """Get the minimum number of table rows to display."""
123+ return self .config_internal .min_table_rows
124+
125+ @min_table_rows .setter
126+ def min_table_rows (self , value : int ) -> None :
127+ """Set the minimum number of table rows to display."""
128+ self .config_internal .min_table_rows = value
129+
130+ @property
131+ def max_cell_length (self ) -> int :
132+ """Get the maximum length of a cell before it gets minimized."""
133+ return self .config_internal .max_cell_length
134+
135+ @max_cell_length .setter
136+ def max_cell_length (self , value : int ) -> None :
137+ """Set the maximum length of a cell before it gets minimized."""
138+ self .config_internal .max_cell_length = value
139+
140+ @property
141+ def max_table_rows_in_repr (self ) -> int :
142+ """Get the maximum number of rows to display in repr string output."""
143+ return self .config_internal .max_table_rows_in_repr
144+
145+ @max_table_rows_in_repr .setter
146+ def max_table_rows_in_repr (self , value : int ) -> None :
147+ """Set the maximum number of rows to display in repr string output."""
148+ self .config_internal .max_table_rows_in_repr = value
149+
150+
82151class SessionConfig :
83152 """Session configuration options."""
84153
0 commit comments