4949 import pyarrow as pa
5050
5151 from datafusion ._internal import DataFrame as DataFrameInternal
52+ from datafusion ._internal import DisplayConfig
5253 from datafusion ._internal import expr as expr_internal
5354
5455from enum import Enum
@@ -823,14 +824,17 @@ def configure_display(
823824 """Configure display options for DataFrame representation.
824825
825826 Args:
826- max_table_bytes: Maximum bytes to display for table presentation (default: 2MB).
827+ max_table_bytes: Maximum bytes to display for table presentation
828+ (default: 2MB).
827829 Set to lower value for large tables to limit memory usage.
828830 min_table_rows: Minimum number of table rows to display (default: 20).
829831 This is used for initial display and in notebooks.
830- max_cell_length: Maximum length of a cell before it gets minimized (default: 25).
832+ max_cell_length: Maximum length of a cell before it gets minimized
833+ (default: 25).
831834 Longer cells will be truncated with an expand button.
832- max_table_rows_in_repr: Maximum number of rows to display in string representation
833- (default: 10).
835+ max_table_rows_in_repr: Maximum number of rows to display in string
836+ representation
837+ (default: 10).
834838
835839 Raises:
836840 ValueError: If any of the provided values are less than or equal to 0.
@@ -844,7 +848,8 @@ def configure_display(
844848 max_table_rows_in_repr ,
845849 )
846850 ):
847- raise ValueError ("All values must be greater than 0." )
851+ error_msg = "All values must be greater than 0."
852+ raise ValueError (error_msg )
848853
849854 self .df .configure_display (
850855 max_table_bytes , min_table_rows , max_cell_length , max_table_rows_in_repr
@@ -855,8 +860,12 @@ def reset_display_config(self) -> None:
855860 self .df .reset_display_config ()
856861
857862 @property
858- def display_config (self ):
859- """Get the current display configuration."""
863+ def display_config (self ) -> DisplayConfig :
864+ """Get the current display configuration.
865+
866+ Returns:
867+ DisplayConfig: The current display configuration settings
868+ """
860869 return self .df .display_config
861870
862871 @deprecated ("Use :py:func:`unnest_columns` instead." )
0 commit comments