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

python: Shouldn't Expr.str.to_decimal's argument be keyword-only? #20564

Open
eitsupi opened this issue Jan 6, 2025 · 2 comments · May be fixed by #20570
Open

python: Shouldn't Expr.str.to_decimal's argument be keyword-only? #20564

eitsupi opened this issue Jan 6, 2025 · 2 comments · May be fixed by #20570
Labels
A-api Area: changes to the public API accepted Ready for implementation enhancement New feature or an improvement of an existing feature
Milestone

Comments

@eitsupi
Copy link
Contributor

eitsupi commented Jan 6, 2025

Description

We can currently specify inference_length by position, but I don't think it is clear what the first argument 100 represents in the following case:

import polars as pl

df = pl.DataFrame(
    {
        "numbers": [
            "40.12",
            "3420.13",
            "120134.19",
            "3212.98",
            "12.90",
            "143.09",
            "143.9",
        ]
    }
)
df.with_columns(numbers_decimal=pl.col("numbers").str.to_decimal(100))

So shouldn't this argument be keyword-only?

@eitsupi eitsupi added the enhancement New feature or an improvement of an existing feature label Jan 6, 2025
@eitsupi eitsupi changed the title python: Shouldn't Expr.str.to_decimal's arguments be keyword-only? python: Shouldn't Expr.str.to_decimal's argument be keyword-only? Jan 6, 2025
@ritchie46
Copy link
Member

Yeah, I see the point. We have to wait for 2.0 though.

@coastalwhite coastalwhite added this to the 2.0.0 milestone Jan 6, 2025
@eitsupi
Copy link
Contributor Author

eitsupi commented Jan 6, 2025

Thanks. Perhaps we can deprecate specify by position (#20570)?

@nameexhaustion nameexhaustion added accepted Ready for implementation A-api Area: changes to the public API labels Jan 7, 2025
@github-project-automation github-project-automation bot moved this to Ready in Backlog Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-api Area: changes to the public API accepted Ready for implementation enhancement New feature or an improvement of an existing feature
Projects
Status: Ready
Development

Successfully merging a pull request may close this issue.

4 participants