Skip to content

Commit

Permalink
Lint, isort, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed Nov 15, 2018
1 parent d49b742 commit 9183b50
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
17 changes: 12 additions & 5 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4208,14 +4208,21 @@ def update(self, other, join='left', overwrite=True, filter_func=None,
If 'raise', will raise a ValueError if the DataFrame and `other`
both contain non-NA data in the same place.
Raises
------
ValueError
When `errors='ignore'` and there's overlapping non-NA data.
.. versionchanged :: 0.24.0
Changed from `raise_conflict=False|True`
to `errors='ignore'|'raise'`.
Returns
-------
Nothing, the object is modified inplace.
None : method directly changes calling object
Raises
------
ValueError
* When `errors='raise'` and there's overlapping non-NA data.
* When `errors` is not either `'ignore'` or `'raise'`
NotImplementedError
* If `join != 'left'`
See Also
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/missing.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def update_array(this, that, overwrite=True, filter_func=None,
dict.update : Similar method for `dict`.
"""
updated = _update_array(this, that, overwrite=overwrite,
filter_func=filter_func, errors=errors)
filter_func=filter_func, errors=errors)
return this if updated is None else updated


Expand Down
5 changes: 2 additions & 3 deletions pandas/tests/series/test_combine_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
from datetime import datetime

import numpy as np
from numpy import nan
import pytest

import pandas as pd
from pandas import DataFrame, DatetimeIndex, Series, compat, date_range
import pandas.util.testing as tm
from pandas.util.testing import assert_series_equal, assert_frame_equal
from pandas.util.testing import assert_frame_equal, assert_series_equal


class TestSeriesCombine():
Expand Down Expand Up @@ -170,7 +169,7 @@ def test_update_raise(self):
s = Series([0, 1, 2, np.nan, np.nan, 5, 6, np.nan])
other = Series([1, 3, np.nan, 7, 9], index=[1, 3, 5, 7, 9])

with tm.assert_raises_regex(ValueError, "Data overlaps"):
with pytest.raises(ValueError, match="Data overlaps"):
s.update(other, errors='raise')

def test_concat_empty_series_dtypes_roundtrips(self):
Expand Down
1 change: 0 additions & 1 deletion pandas/tests/test_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2358,7 +2358,6 @@ def test_update_raise_on_overlap(self):
[[1.5, np.nan, 3.], [1.5, np.nan, 3.],
[1.5, np.nan, 3.],
[1.5, np.nan, 3.]]])
other = Panel([[[]]])

with pytest.raises(ValueError, match='Data overlaps'):
pan.update(pan, errors='raise')
Expand Down

0 comments on commit 9183b50

Please sign in to comment.