BUG: Slicing non monotonic DatetimeIndex did not raise for non-existing keys
- [x] closes #18531
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

The test for historical reasons :) failed after the change. Is this a problem?

If there are "historical reasons", then we could also deprecate it first.
Also, we should clean up the comments about this (as they are now no longer correct)

@phofl can you also add a test where the resulting dataframe would not be empty? So where eg the start label is missing but would fall somewhere in the middle of the range of the index labels > If there are "historical reasons", then we could also deprecate it first.
> Also, we should clean up the comments about this (as they are now no longer correct)
> 
> @phofl can you also add a test where the resulting dataframe would not be empty? So where eg the start label is missing but would fall somewhere in the middle of the range of the index labels

i am not sure there is anything to deprecate, this is just a bug It's also explicitly tested behaviour (I don't know the motivations of the PR that added this test, though) > It's also explicitly tested behaviour (I don't know the motivations of the PR that added this test, though)

its wrong it should raise, pls see the OP Sorry for the confusion with the other issue. It raises for non-monotonic indexes and not for monotonic indexes > its wrong it should raise, pls see the OP

I agree the behaviour seems wrong and we should change it. To be clear I am not arguing for not having it raise an error. I am only saying that if this is explicitly tested behaviour, it *might* be depended upon (again, I don't know when / for what reason this test was added), and we can consider deprecating it first. > > its wrong it should raise, pls see the OP
> 
> I agree the behaviour seems wrong and we should change it. To be clear I am not arguing for not having it raise an error. I am only saying that if this is explicitly tested behaviour, it _might_ be depended upon (again, I don't know when / for what reason this test was added), and we can consider deprecating it first.

fair. ok let's see if possible to deprecate. though am tempted to call this wrong and just a bug fix but let's see. Opened #37819 to deprecate this. If we decide to deprecate first, we can close this one. closing in favor of #37819 