Skip to content

[FEA] Support polars.Expr.str.zfill in cudf-polars #19035

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

Open
brandon-b-miller opened this issue May 29, 2025 · 2 comments · May be fixed by #19081
Open

[FEA] Support polars.Expr.str.zfill in cudf-polars #19035

brandon-b-miller opened this issue May 29, 2025 · 2 comments · May be fixed by #19081
Labels
cudf.polars Issues specific to cudf.polars feature request New feature or request

Comments

@brandon-b-miller
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Today on branch-25.08, we lack support for polars.Expr.str.zfill. Running the example from the docs yields:

import polars as pl
engine = pl.GPUEngine(raise_on_fail=True)

df = pl.DataFrame({"a": [-1, 123, 999999, None]}).lazy()
df = df.with_columns(zfill=pl.col("a").cast(pl.String).str.zfill(4))
res = df.collect(engine=engine)
print(res)
NotImplementedError: String function <Name.ZFill: 44>

Describe the solution you'd like
I'd like the above code to be able to execute using the polars GPU backend. libcudf supports cudf::strings::zfill so this may map nicely 1-1.

Describe alternatives you've considered
N/A

Additional context
#16480

@brandon-b-miller brandon-b-miller added feature request New feature or request cudf.polars Issues specific to cudf.polars labels May 29, 2025
@brandon-b-miller
Copy link
Contributor Author

@davidwendt would it be possible to introduce an overload of cudf::strings::zfill that accepts a column for width ?

@davidwendt
Copy link
Contributor

Certainly. That seems reasonable. I can look into that.

@brandon-b-miller brandon-b-miller linked a pull request Jun 4, 2025 that will close this issue
@GPUtester GPUtester moved this from Todo to In Progress in cuDF Python Jun 4, 2025
@davidwendt davidwendt pinned this issue Jun 4, 2025
@davidwendt davidwendt unpinned this issue Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cudf.polars Issues specific to cudf.polars feature request New feature or request
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

2 participants