49
49
import pyarrow as pa
50
50
51
51
from datafusion ._internal import DataFrame as DataFrameInternal
52
+ from datafusion ._internal import DisplayConfig
52
53
from datafusion ._internal import expr as expr_internal
53
54
54
55
from enum import Enum
@@ -823,14 +824,17 @@ def configure_display(
823
824
"""Configure display options for DataFrame representation.
824
825
825
826
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).
827
829
Set to lower value for large tables to limit memory usage.
828
830
min_table_rows: Minimum number of table rows to display (default: 20).
829
831
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).
831
834
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).
834
838
835
839
Raises:
836
840
ValueError: If any of the provided values are less than or equal to 0.
@@ -844,7 +848,8 @@ def configure_display(
844
848
max_table_rows_in_repr ,
845
849
)
846
850
):
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 )
848
853
849
854
self .df .configure_display (
850
855
max_table_bytes , min_table_rows , max_cell_length , max_table_rows_in_repr
@@ -855,8 +860,12 @@ def reset_display_config(self) -> None:
855
860
self .df .reset_display_config ()
856
861
857
862
@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
+ """
860
869
return self .df .display_config
861
870
862
871
@deprecated ("Use :py:func:`unnest_columns` instead." )
0 commit comments