Skip to content

CLN: remove unnecessary _validate_foo methods #37106

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 49 commits into from
Oct 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
665a522
CLN: dont special-case DatetimeArray indexing
jbrockmendel Sep 26, 2020
36aa013
Merge branch 'master' of https://github.com/pandas-dev/pandas into dt…
jbrockmendel Sep 26, 2020
bdea70b
use parent class _validate_getitem_key
jbrockmendel Sep 26, 2020
8c1acad
Merge branch 'master' of https://github.com/pandas-dev/pandas into dt…
jbrockmendel Oct 3, 2020
42e8e15
test, whatsnew
jbrockmendel Oct 3, 2020
b80fcd8
DOC: update code style for development doc and user guide #36777 (#36…
karasinski Oct 3, 2020
f3125ab
DOC: update code style for user guide for #36777 (#36823)
karasinski Oct 3, 2020
de32fc7
DOC: use black to fix code style in doc pandas-dev#36777 (#36824)
PrayagS Oct 3, 2020
f41ce46
CI: silence codecov for unrelated lines (#36600)
erfannariman Oct 3, 2020
c5c0aad
DOC: reformat doc groupby.rst (#36831)
erfannariman Oct 3, 2020
0071389
TST: GH23452 test reorder_categories() on categorical index (#36648)
fokoid Oct 3, 2020
b9be7ba
Typo fix (#36844)
lrjball Oct 4, 2020
b55d51a
CLN: private funcs in concat.py (#36726)
ivanovmg Oct 4, 2020
74b7b41
ENH: match stdlib behavior for datetimelike comparisons (#36647)
jbrockmendel Oct 4, 2020
9d2399f
doc/source/ecosystem.rst (#36856)
meghanacosmos Oct 4, 2020
f6d3dfc
DOC: black enhancingperf.rst and 10min.rst code style (#36849)
Oct 4, 2020
198af6a
DOC: normalize usage of word "pandas" (#36845)
LeviMatus Oct 4, 2020
54f270c
TYP: update setup.cfg (#36854)
simonjayhawkins Oct 4, 2020
7587c94
CI: Update error message for np_dev (#36864)
dsaxton Oct 4, 2020
e5dcd98
DOC: ran blacken docs tool and checked output to improve formatting #…
maria-ilie Oct 5, 2020
cd82086
CLN: Remove the duplicate configuration of flake8-rst in setup.cfg (#…
Oct 5, 2020
0b5f2dd
upgrade flake8 to 3.8.4 (#36882)
Tazminia Oct 5, 2020
185d2ea
DOC: doc/source/whatsnew (#36857)
meghanacosmos Oct 5, 2020
fa93585
TYP: check_untyped_defs core.arrays.base (#36885)
simonjayhawkins Oct 5, 2020
9216b94
TYP: check_untyped_defs compat.pickle_compat (#36884)
simonjayhawkins Oct 5, 2020
125b3e4
PERF: Improve RollingGroupby.count (#36872)
mroeschke Oct 5, 2020
fa0f216
DOC: 1.1.3 release date (#36887)
simonjayhawkins Oct 5, 2020
30cc26c
Add asv benchmarks for select_dtypes (#36839)
avinashpancham Oct 5, 2020
c77ce8b
DOC: Start v1.1.4 release notes (#36689)
dsaxton Oct 5, 2020
a403610
TST: Period with Timestamp overflow (#34755)
OlivierLuG Oct 5, 2020
fa8e066
CI: Show ipython directive errors (#36863)
dsaxton Oct 6, 2020
ec2b663
Standardize cast_str behavior in all datetimelike fill_value validato…
jbrockmendel Oct 6, 2020
6c60603
CLN: value -> key (#36905)
jbrockmendel Oct 6, 2020
de35fe2
CLN: standardize fixture usage in datetimelike array tests (#36902)
jbrockmendel Oct 6, 2020
605cc0b
DEPR: Index.ravel returning an ndarray (#36900)
jbrockmendel Oct 6, 2020
6e34063
REF: collect reduction tests (#36901)
jbrockmendel Oct 6, 2020
2847337
PERF: Index._shallow_copy shares _cache with copies of self (#36840)
topper-123 Oct 6, 2020
265ffb0
checkout upstream versions
jbrockmendel Oct 7, 2020
0553a99
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Oct 7, 2020
c956081
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Oct 9, 2020
9923ac3
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Oct 9, 2020
92e6853
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Oct 10, 2020
7d13382
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Oct 11, 2020
b4a2714
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Oct 11, 2020
4c59814
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Oct 12, 2020
af61fe8
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Oct 13, 2020
d3dad4c
Merge branch 'master' of https://github.com/pandas-dev/pandas into re…
jbrockmendel Oct 13, 2020
5b80f24
CLN: remove unnecessary validate_ methdos
jbrockmendel Oct 13, 2020
80561bc
dummy commit to force CI
jbrockmendel Oct 13, 2020
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
12 changes: 3 additions & 9 deletions pandas/core/arrays/_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,10 @@ def _validate_shift_value(self, fill_value):
return self._validate_fill_value(fill_value)

def __setitem__(self, key, value):
key = self._validate_setitem_key(key)
key = check_array_indexer(self, key)
value = self._validate_setitem_value(value)
self._ndarray[key] = value

def _validate_setitem_key(self, key):
return check_array_indexer(self, key)

def _validate_setitem_value(self, value):
return value

Expand All @@ -198,18 +195,15 @@ def __getitem__(self, key):
return self._box_func(result)
return self._from_backing_data(result)

key = self._validate_getitem_key(key)
key = extract_array(key, extract_numpy=True)
key = check_array_indexer(self, key)
result = self._ndarray[key]
if lib.is_scalar(result):
return self._box_func(result)

result = self._from_backing_data(result)
return result

def _validate_getitem_key(self, key):
key = extract_array(key, extract_numpy=True)
return check_array_indexer(self, key)

@doc(ExtensionArray.fillna)
def fillna(self: _T, value=None, method=None, limit=None) -> _T:
value, method = validate_fillna_kwargs(value, method)
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
from pandas.core.arrays._mixins import NDArrayBackedExtensionArray
import pandas.core.common as com
from pandas.core.construction import array, extract_array
from pandas.core.indexers import check_setitem_lengths
from pandas.core.indexers import check_array_indexer, check_setitem_lengths
from pandas.core.ops.common import unpack_zerodim_and_defer
from pandas.core.ops.invalid import invalid_comparison, make_invalid_op

Expand Down Expand Up @@ -294,7 +294,7 @@ def _get_getitem_freq(self, key):
elif self.ndim != 1:
freq = None
else:
key = self._validate_getitem_key(key) # maybe ndarray[bool] -> slice
key = check_array_indexer(self, key) # maybe ndarray[bool] -> slice
freq = None
if isinstance(key, slice):
if self.freq is not None and key.step is not None:
Expand Down