@@ -104,6 +104,15 @@ def __init__(
104104 max_table_rows_in_repr: Maximum number of rows to display in repr
105105 string output (default: 10)
106106 """
107+ # Validate values if they are not None
108+ if max_table_bytes is not None :
109+ self ._validate_positive (max_table_bytes , "max_table_bytes" )
110+ if min_table_rows is not None :
111+ self ._validate_positive (min_table_rows , "min_table_rows" )
112+ if max_cell_length is not None :
113+ self ._validate_positive (max_cell_length , "max_cell_length" )
114+ if max_table_rows_in_repr is not None :
115+ self ._validate_positive (max_table_rows_in_repr , "max_table_rows_in_repr" )
107116 self .config_internal = DataframeDisplayConfigInternal (
108117 max_table_bytes = max_table_bytes ,
109118 min_table_rows = min_table_rows ,
@@ -180,46 +189,6 @@ def __init__(self, config_options: dict[str, str] | None = None) -> None:
180189 """
181190 self .config_internal = SessionConfigInternal (config_options )
182191
183- def with_dataframe_display_config (
184- self ,
185- max_table_bytes : Optional [int ] = None ,
186- min_table_rows : Optional [int ] = None ,
187- max_cell_length : Optional [int ] = None ,
188- max_table_rows_in_repr : Optional [int ] = None ,
189- ) -> SessionConfig :
190- """Configure the display options for DataFrames.
191-
192- Args:
193- max_table_bytes: Maximum bytes to display for table presentation
194- (default: 2MB)
195- min_table_rows: Minimum number of table rows to display (default: 20)
196- max_cell_length: Maximum length of a cell before it gets minimized
197- (default: 25)
198- max_table_rows_in_repr: Maximum number of rows to display in repr string
199- output (default: 10)
200-
201- Returns:
202- A new :py:class:`SessionConfig` object with the updated display settings.
203- """
204- display_config = DataframeDisplayConfigInternal (
205- max_table_bytes = max_table_bytes ,
206- min_table_rows = min_table_rows ,
207- max_cell_length = max_cell_length ,
208- max_table_rows_in_repr = max_table_rows_in_repr ,
209- )
210-
211- display_config = DataframeDisplayConfigInternal (
212- max_table_bytes = max_table_bytes ,
213- min_table_rows = min_table_rows ,
214- max_cell_length = max_cell_length ,
215- max_table_rows_in_repr = max_table_rows_in_repr ,
216- )
217-
218- self .config_internal = self .config_internal .with_dataframe_display_config (
219- display_config
220- )
221- return self
222-
223192 def with_create_default_catalog_and_schema (
224193 self , enabled : bool = True
225194 ) -> SessionConfig :
0 commit comments