Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python): Fix return type for add_business_days, millennium, century and combine methods in Series.dt namespace #20436

Merged
merged 2 commits into from
Dec 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions py-polars/polars/series/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def add_business_days(

Returns
-------
Expr
Series
Data type is preserved.

Examples
Expand Down Expand Up @@ -373,7 +373,7 @@ def strftime(self, format: str) -> Series:
"""
return self.to_string(format)

def millennium(self) -> Expr:
def millennium(self) -> Series:
"""
Extract the millennium from underlying representation.

Expand All @@ -383,8 +383,8 @@ def millennium(self) -> Expr:

Returns
-------
Expr
Expression of data type :class:`Int32`.
Series
Series of data type :class:`Int32`.

Examples
--------
Expand All @@ -411,7 +411,7 @@ def millennium(self) -> Expr:
]
"""

def century(self) -> Expr:
def century(self) -> Series:
"""
Extract the century from underlying representation.

Expand All @@ -421,8 +421,8 @@ def century(self) -> Expr:

Returns
-------
Expr
Expression of data type :class:`Int32`.
Series
Series of data type :class:`Int32`.

Examples
--------
Expand Down Expand Up @@ -1924,7 +1924,7 @@ def round(self, every: str | dt.timedelta | IntoExprColumn) -> Series:
]
"""

def combine(self, time: dt.time | Series, time_unit: TimeUnit = "us") -> Expr:
def combine(self, time: dt.time | Series, time_unit: TimeUnit = "us") -> Series:
"""
Create a naive Datetime from an existing Date/Datetime expression and a Time.

Expand Down
Loading