From 5ba53a4df23f5d77b6fa64dd4f5093f769326647 Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Fri, 3 Feb 2023 17:24:49 +0100 Subject: [PATCH] fix(python): Tiny improvement of `Field` repr (#6640) --- py-polars/polars/datatypes.py | 2 +- py-polars/tests/unit/test_datatypes.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/py-polars/polars/datatypes.py b/py-polars/polars/datatypes.py index b897a902fbe9..a355d6f6c74f 100644 --- a/py-polars/polars/datatypes.py +++ b/py-polars/polars/datatypes.py @@ -369,7 +369,7 @@ def __eq__(self, other: Field) -> bool: # type: ignore[override] def __repr__(self) -> str: class_name = self.__class__.__name__ - return f"{class_name}({self.name!r}: {self.dtype})" + return f"{class_name}({self.name!r}, {self.dtype})" class Struct(NestedType): diff --git a/py-polars/tests/unit/test_datatypes.py b/py-polars/tests/unit/test_datatypes.py index 6c5d434f751b..11b12877f7ed 100644 --- a/py-polars/tests/unit/test_datatypes.py +++ b/py-polars/tests/unit/test_datatypes.py @@ -80,7 +80,7 @@ def test_dtypes_hashable() -> None: (pl.Struct, "Struct"), ( pl.Struct({"name": pl.Utf8, "ids": pl.List(pl.UInt32)}), - "Struct([Field('name': Utf8), Field('ids': List(UInt32))])", + "Struct([Field('name', Utf8), Field('ids', List(UInt32))])", ), ], )