Skip to content
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

API/DEPR: replace "raise_conflict" with "errors" for df.update #23657

Merged
merged 6 commits into from
Nov 15, 2018

Conversation

h-vetinari
Copy link
Contributor

This is split off from #23192, as requested per review (because the PR was getting larger and larger).

@pep8speaks
Copy link

pep8speaks commented Nov 12, 2018

Hello @h-vetinari! Thanks for updating the PR.

Comment last updated on November 14, 2018 at 20:44 Hours UTC

warnings.simplefilter("ignore", FutureWarning)
# do not warn about constructing Panel when reindexing
result = super(Panel, self).reindex(**kwargs)
return result
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copied from #23192:

I had no intention to add this warning filter here, but otherwise I cannot test the raise_conflict deprecation for Panel, as this warning was throwing me off from trying to catch the deprecation warning. If we don't care about testing that kwarg deprecation for Panel, I can revert this change here.

Panel, or object coercible to Panel. Aligns on items
Modify Panel in place using non-NA values from other Panel.

May also use object coercible to Panel. Will align on items.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ran the doctest validation, therefore changed more than just the errors text. But not essential to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

this is fine

Returns
-------
None : method directly changes calling object

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added due to running docstring validation

@codecov
Copy link

codecov bot commented Nov 13, 2018

Codecov Report

Merging #23657 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #23657      +/-   ##
==========================================
+ Coverage   92.24%   92.25%   +<.01%     
==========================================
  Files         161      161              
  Lines       51339    51346       +7     
==========================================
+ Hits        47360    47367       +7     
  Misses       3979     3979
Flag Coverage Δ
#multiple 90.64% <100%> (ø) ⬆️
#single 42.34% <63.63%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/frame.py 97.02% <100%> (ø) ⬆️
pandas/core/panel.py 97.92% <100%> (+0.01%) ⬆️
pandas/core/series.py 93.68% <0%> (ø) ⬆️

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 e413c49...5ff6261. Read the comment docs.

@gfyoung gfyoung added Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Deprecate Functionality to remove in pandas labels Nov 13, 2018
Copy link
Member

@gfyoung gfyoung left a comment

Choose a reason for hiding this comment

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

cc @jreback
cc @datapythonista (b/c of the doc changes)

raise_conflict : bool, default False
If True, will raise a ValueError if the DataFrame and `other`
errors : {'raise', 'ignore'}, default 'ignore'
If 'raise', will raise a ValueError if the DataFrame and `other`
Copy link
Contributor

Choose a reason for hiding this comment

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

versionchanged tag

Returns
-------
None : method directly changes calling object

Raises
------
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add an if for valid errors values (e.g. raise/error), and test for passing bad values in the tests themselves

Panel, or object coercible to Panel. Aligns on items
Modify Panel in place using non-NA values from other Panel.

May also use object coercible to Panel. Will align on items.
Copy link
Contributor

Choose a reason for hiding this comment

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

this is fine

@@ -322,7 +322,9 @@ def test_update_raise(self):
other = DataFrame([[2., nan],
[nan, 7]], index=[1, 3], columns=[1, 2])
with pytest.raises(ValueError, match="Data overlaps"):
df.update(other, raise_conflict=True)
df.update(other, errors='raise')
Copy link
Contributor

Choose a reason for hiding this comment

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

can you move this to another test, e.g. test_update_deprecation

@jreback jreback added this to the 0.24.0 milestone Nov 14, 2018
@jreback jreback merged commit e50b5fe into pandas-dev:master Nov 15, 2018
@jreback
Copy link
Contributor

jreback commented Nov 15, 2018

thanks

thoo added a commit to thoo/pandas that referenced this pull request Nov 15, 2018
* upstream/master:
  BUG: to_html misses truncation indicators (...) when index=False (pandas-dev#22786)
  API/DEPR: replace "raise_conflict" with "errors" for df.update (pandas-dev#23657)
  BUG: Append DataFrame to Series with dateutil timezone (pandas-dev#23685)
  CLN/CI: Catch that stderr-warning! (pandas-dev#23706)
  ENH: Allow for join between two multi-index dataframe instances (pandas-dev#20356)
  Ensure Index._data is an ndarray (pandas-dev#23628)
  DOC: flake8-per-pr for windows users (pandas-dev#23707)
  DOC: Handle exceptions when computing contributors. (pandas-dev#23714)
  DOC: Validate space before colon docstring parameters pandas-dev#23483 (pandas-dev#23506)
  BUG-22984 Fix truncation of DataFrame representations (pandas-dev#22987)
@h-vetinari h-vetinari deleted the depr_raise_conflict branch November 15, 2018 19:00
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API/DEPR: replace raise_conflict-kwarg in df.update with errors
4 participants