From af144730bbb1b8df04d991fcdb063060fd1eadcb Mon Sep 17 00:00:00 2001 From: Sammy Sidhu Date: Wed, 29 Nov 2023 12:33:32 -0800 Subject: [PATCH] add to type stub --- daft/daft.pyi | 4 ++++ daft/series.py | 2 +- tests/series/test_partitioning.py | 8 ++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/daft/daft.pyi b/daft/daft.pyi index 3de0124309..42bd30c7e8 100644 --- a/daft/daft.pyi +++ b/daft/daft.pyi @@ -805,6 +805,10 @@ class PySeries: def dt_month(self) -> PySeries: ... def dt_year(self) -> PySeries: ... def dt_day_of_week(self) -> PySeries: ... + def partitioning_days(self) -> PySeries: ... + def partitioning_hours(self) -> PySeries: ... + def partitioning_months(self) -> PySeries: ... + def partitioning_years(self) -> PySeries: ... def list_lengths(self) -> PySeries: ... def image_decode(self) -> PySeries: ... def image_encode(self, image_format: ImageFormat) -> PySeries: ... diff --git a/daft/series.py b/daft/series.py index 1a81e7d433..807f23bbe2 100644 --- a/daft/series.py +++ b/daft/series.py @@ -488,7 +488,7 @@ def image(self) -> SeriesImageNamespace: return SeriesImageNamespace.from_series(self) @property - def part(self) -> SeriesPartitioningNamespace: + def partitioning(self) -> SeriesPartitioningNamespace: return SeriesPartitioningNamespace.from_series(self) def __reduce__(self) -> tuple: diff --git a/tests/series/test_partitioning.py b/tests/series/test_partitioning.py index d54dff43ea..66fa7422dd 100644 --- a/tests/series/test_partitioning.py +++ b/tests/series/test_partitioning.py @@ -24,7 +24,7 @@ ) def test_partitioning_days(input, dtype, expected): s = Series.from_pylist(input).cast(dtype) - assert s.part.days().to_pylist() == expected + assert s.partitioning.days().to_pylist() == expected @pytest.mark.parametrize( @@ -49,7 +49,7 @@ def test_partitioning_days(input, dtype, expected): ) def test_partitioning_months(input, dtype, expected): s = Series.from_pylist(input).cast(dtype) - assert s.part.months().to_pylist() == expected + assert s.partitioning.months().to_pylist() == expected @pytest.mark.parametrize( @@ -70,7 +70,7 @@ def test_partitioning_months(input, dtype, expected): ) def test_partitioning_years(input, dtype, expected): s = Series.from_pylist(input).cast(dtype) - assert s.part.years().to_pylist() == expected + assert s.partitioning.years().to_pylist() == expected @pytest.mark.parametrize( @@ -91,4 +91,4 @@ def test_partitioning_years(input, dtype, expected): ) def test_partitioning_hours(input, dtype, expected): s = Series.from_pylist(input).cast(dtype) - assert s.part.hours().to_pylist() == expected + assert s.partitioning.hours().to_pylist() == expected