From e8548e0c3b381b7a105bfe87947b7fae0be2aae7 Mon Sep 17 00:00:00 2001 From: Romano Vacca Date: Mon, 25 Sep 2023 13:08:55 +0200 Subject: [PATCH] series column name was missing --- crates/polars-core/src/fmt.rs | 2 +- py-polars/tests/unit/test_constructors.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/polars-core/src/fmt.rs b/crates/polars-core/src/fmt.rs index abfb29a5410cd..97fed1703701c 100644 --- a/crates/polars-core/src/fmt.rs +++ b/crates/polars-core/src/fmt.rs @@ -359,7 +359,7 @@ impl Debug for Series { "Series" ), DataType::Null => { - format_nullarray!(f, self.len(), "nullarray", "null", "Series") + format_nullarray!(f, self.len(), "nullarray", self.name(), "Series") }, DataType::Binary => { format_array!(f, self.binary().unwrap(), "binary", self.name(), "Series") diff --git a/py-polars/tests/unit/test_constructors.py b/py-polars/tests/unit/test_constructors.py index 852d87a7145e6..fab5f46e466f3 100644 --- a/py-polars/tests/unit/test_constructors.py +++ b/py-polars/tests/unit/test_constructors.py @@ -594,7 +594,7 @@ def test_nullarray_print_format() -> None: assert df_null.schema == {"a": pl.Null} assert df_null.rows() == [(None,), (None,)] - expected_string = "shape: (2,)\nSeries: 'null' [nullarray]\n[\n\tnull\n\tnull\n]" + expected_string = "shape: (2,)\nSeries: 'a' [nullarray]\n[\n\tnull\n\tnull\n]" assert str(df_null["a"]) == expected_string