Skip to content

DEPR: iterkv change Deprecation to FutureWarning #10867

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
Aug 21, 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
14 changes: 7 additions & 7 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def iterkv(self, *args, **kwargs):
"iteritems alias used to get around 2to3. Deprecated"
warnings.warn("iterkv is deprecated and will be removed in a future "
"release, use ``iteritems`` instead.",
DeprecationWarning)
FutureWarning)
return self.iteritems(*args, **kwargs)

def __len__(self):
Expand Down Expand Up @@ -2004,13 +2004,13 @@ def sample(self, n=None, frac=None, replace=False, weights=None, random_state=No
Sample with or without replacement. Default = False.
weights : str or ndarray-like, optional
Default 'None' results in equal probability weighting.
If passed a Series, will align with target object on index. Index
If passed a Series, will align with target object on index. Index
values in weights not found in sampled object will be ignored and
index values in sampled object not in weights will be assigned
weights of zero.
index values in sampled object not in weights will be assigned
weights of zero.
If called on a DataFrame, will accept the name of a column
when axis = 0.
Unless weights are a Series, weights must be same length as axis
Unless weights are a Series, weights must be same length as axis
being sampled.
If weights do not sum to 1, they will be normalized to sum to 1.
Missing values in the weights column will be treated as zero.
Expand Down Expand Up @@ -2040,8 +2040,8 @@ def sample(self, n=None, frac=None, replace=False, weights=None, random_state=No
if weights is not None:

# If a series, align with frame
if isinstance(weights, pd.Series):
weights = weights.reindex(self.axes[axis])
if isinstance(weights, pd.Series):
weights = weights.reindex(self.axes[axis])

# Strings acceptable if a dataframe and axis = 0
if isinstance(weights, string_types):
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -14188,7 +14188,7 @@ def test_take(self):
assert_frame_equal(result, expected)

def test_iterkv_deprecation(self):
with tm.assert_produces_warning(DeprecationWarning):
with tm.assert_produces_warning(FutureWarning):
self.mixed_float.iterkv()

def test_iterkv_names(self):
Expand Down