-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat: Add list.pad_start()
#20674
base: main
Are you sure you want to change the base?
feat: Add list.pad_start()
#20674
Conversation
list.pad_start()
list.pad_start()
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #20674 +/- ##
==========================================
+ Coverage 78.85% 79.76% +0.91%
==========================================
Files 1558 1561 +3
Lines 221055 221887 +832
Branches 2527 2530 +3
==========================================
+ Hits 174318 176996 +2678
+ Misses 46159 44309 -1850
- Partials 578 582 +4 ☔ View full report in Codecov by Sentry. |
It should be possible to support more types (date, datetime, duration, maybe categorical and enum also?), but I'd like to have some feedback on the current implementation before, cf the two questions in the first post. In particular, for now it casts categoricals to string in this case: pl.DataFrame({"a": [["a"], ["a", "b"]]}, schema={"a": pl.List(pl.Categorical)}).select(
pl.col("a").list.pad_start("foo")
)
# shape: (2, 1)
# ┌──────────────┐
# │ a │
# │ --- │
# │ list[str] │
# ╞══════════════╡
# │ ["foo", "a"] │
# │ ["a", "b"] │
# └──────────────┘ which I'm not sure is correct. |
Fixes #10283
Currently, this allows to do this:
Questions:
match
statement, but it's not obvious to me how to reduce it. Any idea?