Skip to content

Adding a future deprecation warning to split params #2

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

Merged
merged 1 commit into from
Apr 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions pandas/core/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,9 @@ def str_split(arr, pat=None, n=None, return_type='series'):
if return_type in ('frame', 'expand') and isinstance(arr, Index):
raise ValueError("return_type='frame' is not supported for string "
"methods on Index")
if return_type in ('series', 'index', 'frame'):
warnings.warn(("'series', 'index' and 'frame' are deprecated. Please use 'same' or 'expand' instead"),
FutureWarning)
if pat is None:
if n is None or n == 0:
n = -1
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,6 @@ def test_str_attribute(self):
idx.str.split(return_type='frame')
with self.assertRaisesRegexp(ValueError, 'not supported'):
idx.str.split(return_type='expand')

# test boolean case, should return np.array instead of boolean Index
idx = Index(['a1', 'a2', 'b1', 'b2'])
expected = np.array([True, True, False, False])
Expand Down