diff --git a/py-polars/polars/datatypes.py b/py-polars/polars/datatypes.py index 2399a31c201d..b897a902fbe9 100644 --- a/py-polars/polars/datatypes.py +++ b/py-polars/polars/datatypes.py @@ -126,7 +126,7 @@ class DataTypeClass(type): def __repr__(cls) -> str: return cls.__name__ - def string_repr(cls) -> str: + def _string_repr(cls) -> str: return dtype_str_repr(cls) @@ -143,7 +143,7 @@ def __new__(cls, *args: Any, **kwargs: Any) -> PolarsDataType: # type: ignore[m def __reduce__(self) -> Any: return (_custom_reconstruct, (type(self), object, None), self.__dict__) - def string_repr(self) -> str: + def _string_repr(self) -> str: return dtype_str_repr(self) diff --git a/py-polars/polars/internals/dataframe/frame.py b/py-polars/polars/internals/dataframe/frame.py index 6e3ce1863aad..103143d01cb0 100644 --- a/py-polars/polars/internals/dataframe/frame.py +++ b/py-polars/polars/internals/dataframe/frame.py @@ -2786,9 +2786,9 @@ def glimpse(self: DF) -> str: def _parse_column(col_name: str, dtype: PolarsDataType) -> tuple[str, str, str]: dtype_str = ( - f"<{DataTypeClass.string_repr(dtype)}>" + f"<{DataTypeClass._string_repr(dtype)}>" if isinstance(dtype, DataTypeClass) - else f"<{dtype.string_repr()}>" + else f"<{dtype._string_repr()}>" ) val = self[:max_num_values][col_name].to_list() val_str = ", ".join(map(str, val))