Skip to content

Commit

Permalink
depr(python): Make parameter of str.to_decimal keyword-only (pola-r…
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi authored Jan 12, 2025
1 parent 74dad84 commit c82fdd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions py-polars/polars/expr/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from polars import functions as F
from polars._utils.deprecation import (
deprecate_function,
deprecate_nonkeyword_arguments,
issue_deprecation_warning,
)
from polars._utils.parse import parse_into_expression
Expand Down Expand Up @@ -314,6 +315,7 @@ def strptime(
msg = "`dtype` must be of type {Date, Datetime, Time}"
raise ValueError(msg)

@deprecate_nonkeyword_arguments(allowed_args=["self"], version="1.20.0")
def to_decimal(
self,
inference_length: int = 100,
Expand Down
3 changes: 2 additions & 1 deletion py-polars/polars/series/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import TYPE_CHECKING

from polars._utils.deprecation import deprecate_function
from polars._utils.deprecation import deprecate_function, deprecate_nonkeyword_arguments
from polars._utils.unstable import unstable
from polars._utils.various import no_default
from polars.datatypes.constants import N_INFER_DEFAULT
Expand Down Expand Up @@ -271,6 +271,7 @@ def strptime(
]
"""

@deprecate_nonkeyword_arguments(allowed_args=["self"], version="1.20.0")
def to_decimal(
self,
inference_length: int = 100,
Expand Down

0 comments on commit c82fdd4

Please sign in to comment.