-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix(python): series.search_sorted could support more types of input #15940
Conversation
8a96067
to
b7cc718
Compare
@@ -2263,7 +2265,7 @@ def search_sorted(self, element: IntoExpr, side: SearchSortedSide = "any") -> Se | |||
│ 0 ┆ 2 ┆ 4 │ | |||
└──────┴───────┴─────┘ | |||
""" | |||
element = parse_as_expression(element) | |||
element = parse_as_expression(element, list_as_lit=False, str_as_lit=True) # type: ignore[arg-type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list_as_lit
=> False
is ok as List
dtype is not supported.
But str_as_lit
=> True
should be careful, It breaks the previous behavior for str
type input. But I want to argue this as a bug-fix, because we already had support for String type in rust side, but it just didn't get exposed due to the bug in python side. If we had been aware of this from the beginning, str
would never have been used as a column name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# type: ignore[arg-type]
as the same reason with #12792.
b7cc718
to
d222877
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15940 +/- ##
==========================================
- Coverage 81.25% 81.25% -0.01%
==========================================
Files 1381 1381
Lines 176597 176598 +1
Branches 3028 3028
==========================================
- Hits 143496 143493 -3
- Misses 32620 32623 +3
- Partials 481 482 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Fixes #15911.