-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Avoid splitting string with list() (#20592) #20615
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
Conversation
This needs tests |
Codecov Report
@@ Coverage Diff @@
## master #20615 +/- ##
==========================================
+ Coverage 91.82% 91.84% +0.02%
==========================================
Files 153 153
Lines 49256 49258 +2
==========================================
+ Hits 45227 45243 +16
+ Misses 4029 4015 -14
Continue to review full report at Codecov.
|
@@ -951,7 +951,10 @@ def _set_with(self, key, value): | |||
|
|||
if not isinstance(key, (list, Series, np.ndarray, Series)): |
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.
looks like extra Series listed here.
@@ -951,7 +951,10 @@ def _set_with(self, key, value): | |||
|
|||
if not isinstance(key, (list, Series, np.ndarray, Series)): | |||
try: | |||
key = list(key) |
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.
let's break this if up to specificy target a string e.g.
if isinstance(key, compat.string_types):
......
elif not isinstance(key, (list, Series, np.ndarray)):
....
closing as stale, though would certainly take a PR here |
Solves #20592 and I doubt that there are any cases when a key string should be split by
list()