Skip to content

Commit

Permalink
add to type stub
Browse files Browse the repository at this point in the history
  • Loading branch information
samster25 committed Nov 29, 2023
1 parent 2758beb commit af14473
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions daft/daft.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down
2 changes: 1 addition & 1 deletion daft/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions tests/series/test_partitioning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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

0 comments on commit af14473

Please sign in to comment.