Skip to content

Commit

Permalink
fix(python): Tiny improvement of Field repr (#6640)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego authored Feb 3, 2023
1 parent 1f9bb06 commit 5ba53a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion py-polars/polars/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/test_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))])",
),
],
)
Expand Down

0 comments on commit 5ba53a4

Please sign in to comment.