Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

fredrik-1
Copy link

Solves #20592 and I doubt that there are any cases when a key string should be split by list()

@WillAyd
Copy link
Member

WillAyd commented Apr 5, 2018

This needs tests

@codecov
Copy link

codecov bot commented Apr 5, 2018

Codecov Report

Merging #20615 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Flag Coverage Δ
#multiple 90.23% <100%> (+0.02%) ⬆️
#single 41.9% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/series.py 93.91% <100%> (+0.01%) ⬆️
pandas/util/testing.py 84.73% <0%> (+0.2%) ⬆️
pandas/plotting/_converter.py 66.81% <0%> (+1.73%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d610a4...9535274. Read the comment docs.

@TomAugspurger
Copy link
Contributor

@TomAugspurger TomAugspurger added the Indexing Related to indexing on series/frames, not to indexes themselves label Apr 5, 2018
@TomAugspurger TomAugspurger added this to the 0.23.0 milestone Apr 5, 2018
@@ -951,7 +951,10 @@ def _set_with(self, key, value):

if not isinstance(key, (list, Series, np.ndarray, Series)):
Copy link
Contributor

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)
Copy link
Contributor

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)):
    ....

@jreback jreback removed this from the 0.23.0 milestone Apr 5, 2018
@jreback
Copy link
Contributor

jreback commented Sep 25, 2018

closing as stale, though would certainly take a PR here

@jreback jreback closed this Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants