-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix(python): Allow for IntoExprColumn arguments in Series.str.replace and Series.str.replace_all
#24644
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
base: main
Are you sure you want to change the base?
Conversation
str.replace and str.replace_allIntoExprColumn arguments in str.replace and str.replace_all
IntoExprColumn arguments in str.replace and str.replace_allIntoExprColumn arguments in serie.str.replace and series.str.replace_all
IntoExprColumn arguments in serie.str.replace and series.str.replace_allIntoExprColumn arguments in series.str.replace and series.str.replace_all
IntoExprColumn arguments in series.str.replace and series.str.replace_allIntoExprColumn arguments in Series.str.replace and Series.str.replace_all
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24644 +/- ##
==========================================
- Coverage 81.71% 81.71% -0.01%
==========================================
Files 1700 1700
Lines 233283 233283
Branches 2996 2996
==========================================
- Hits 190633 190617 -16
- Misses 41888 41904 +16
Partials 762 762 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I think
|
|
Sure, this is one of the cases with It's the same in polars/py-polars/polars/series/datetime.py Line 1753 in 769d990
Would that be acceptable? |
|
I think that indeed makes sense and is acceptable. |
606c8ce to
4e4c7e5
Compare
4e4c7e5 to
132d4e7
Compare
I am confused by this, if you have a column named "1y" then what happens when you pass |
|
Then it would be interpreted as a string literal "1 year" |
Is this a priority issue then? It first tries to interpret as literal string, then as an column-convertible expression? Maybe I don't understand |
Non-Python-literal input are already allowed here, I think the type hints just didn't get updated in #4516 ?
I've updated to match how it's typed in
extract:polars/py-polars/polars/series/string.py
Line 824 in 88cd1b0
polars/py-polars/polars/expr/string.py
Line 1436 in 88cd1b0