Open
Description
We are not consistent about whether we do validation checks on no-ops
Examples of no-ops:
datetimelike_array[empty_indexer] = empty_values_wrong_dtype
# <-- we do not raiseseries_dt64[empty_indexer] = empty_object_dtype
# <-- we cast to object, meaning we did raise internallyarr_with_no_nas.fillna(invalid_fill_value)
# <-- we mostly dont raise, see belowinterval_index.take(indexer_with_no_negative_ones, fill_value=something_invalid)
# <-- we do not raise
pd.array([1, 4, 6]).fillna("foo")
pd.array([1.0, 4.9, 6.0]).fillna("foo")
pd.IntervalIndex.from_breaks(range(3)).fillna("foo")
dti = pd.date_range("2016-01-01", periods=3)
dti.fillna("foo")
(dti - dti).fillna("foo")
dti.to_period("D").fillna("foo")
pd.Categorical(dti).fillna("foo") <-- raises
I think we should (with deprecation cycles where necessary) aim to be consistently strict in this genre of check.
Update: listing related issues as I find them
- BUG: drop(level=.) doesn't raise if label is absent #18561 BUG: drop(level=.) doesn't raise if label is absent