Skip to content

Commit

Permalink
Move warning out of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Aug 27, 2018
1 parent a3ea6fc commit 730ab79
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2024,12 +2024,11 @@ def _get_series_list(self, others, ignore_index=False):
los = los + nxt
join_warn = join_warn or wnx

if depr_warn:
warnings.warn('list-likes other than Series, Index, '
'or np.ndarray WITHIN another list-like '
'are deprecated and will be removed in '
'a future version.',
FutureWarning, stacklevel=3)
if depr_warn:
warnings.warn('list-likes other than Series, Index, or '
'np.ndarray WITHIN another list-like are '
'deprecated and will be removed in a future '
'version.', FutureWarning, stacklevel=3)
return (los, join_warn)
elif all(not is_list_like(x) for x in others):
return ([Series(others, index=idx)], False)
Expand Down

0 comments on commit 730ab79

Please sign in to comment.