Skip to content

FIX: add additional condition to check invalid type(#28277) #28319

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 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CLN: fix pep8 E231 and E501
  • Loading branch information
paichana committed Sep 6, 2019
commit fb6c825dd71b3131136ab7ad8ecce66dd7821deb
4 changes: 3 additions & 1 deletion pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2107,7 +2107,9 @@ def _get_series_list(self, others):
elif isinstance(others, np.ndarray) and others.ndim == 2:
others = DataFrame(others, index=idx)
return [others[x] for x in others]
elif is_list_like(others, allow_sets=False) and not isinstance(others,type(self)):
elif is_list_like(others, allow_sets=False) and not isinstance(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this. I think the real issue is that is_list_like returns True for s.str when it shouldn't, though I do see that is also technically Iterable so maybe this should be allowed and just fixed

others, type(self)
):
others = list(others) # ensure iterators do not get read twice etc

# in case of list-like `others`, all elements must be
Expand Down