Skip to content

Commit

Permalink
feat(python): Stabilize methods/functions (#20850)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 authored Jan 24, 2025
1 parent 332bd7d commit 7bf42dd
Show file tree
Hide file tree
Showing 12 changed files with 191 additions and 241 deletions.
6 changes: 1 addition & 5 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -8808,9 +8808,9 @@ def unpivot(

return self._from_pydf(self._df.unpivot(on, index, value_name, variable_name))

@unstable()
def unstack(
self,
*,
step: int,
how: UnstackDirection = "vertical",
columns: ColumnNameOrSelector | Sequence[ColumnNameOrSelector] | None = None,
Expand All @@ -8819,10 +8819,6 @@ def unstack(
"""
Unstack a long table to a wide form without doing an aggregation.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
This can be much faster than a pivot, because it can skip the grouping phase.
Parameters
Expand Down
6 changes: 0 additions & 6 deletions py-polars/polars/expr/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from polars._utils.convert import parse_as_duration_string
from polars._utils.deprecation import deprecate_function, deprecate_nonkeyword_arguments
from polars._utils.parse import parse_into_expression, parse_into_list_of_expressions
from polars._utils.unstable import unstable
from polars._utils.wrap import wrap_expr
from polars.datatypes import DTYPE_TEMPORAL_UNITS, Date, Int32

Expand Down Expand Up @@ -280,15 +279,10 @@ def truncate(self, every: str | dt.timedelta | Expr) -> Expr:
every = parse_into_expression(every, str_as_lit=True)
return wrap_expr(self._pyexpr.dt_truncate(every))

@unstable()
def round(self, every: str | dt.timedelta | IntoExprColumn) -> Expr:
"""
Divide the date/datetime range into buckets.
.. warning::
This functionality is considered **unstable**. It may be changed
at any point without it being considered a breaking change.
- Each date/datetime in the first half of the interval
is mapped to the start of its bucket.
- Each date/datetime in the second half of the interval
Expand Down
Loading

0 comments on commit 7bf42dd

Please sign in to comment.