ENH: Add `milliseconds` field support for `pd.DateOffset`
State: closed

- [x] closes #43371 
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry


Labels:
name: Enhancement
name: Frequency
description: DateOffsets

Comments:
you would need tests to prove that this works. We don't currently have support for this. Its possible, but non-trivial to add.
@jreback - Thanks for pointing this out. I also noticed there isn't a comprehensive test for offset constructions. Looked into https://github.com/pandas-dev/pandas/blob/26064f0f7ea01607a85b399ee4f3de29a864f338/pandas/tests/tseries/offsets/test_offsets.py and https://github.com/pandas-dev/pandas/blob/master/pandas/tests/tslibs/test_liboffsets.py.

I think we might also want to test binops with Timestamp and `millisecond`.
@jreback The old `TestDateOffset` seems lacking comprehensive coverage over the various parameters of `DateOffset`. I've restructured the class - maintaining the corner cases while extending with more coverage over the parameters and operations. Specifically `__add__`, `__radd__`, `__rsub__`, `__mul__` and combination of `mul` and `add`.
hmm look near there thought we had another file (but ok if u made comprehensive)
@jreback , can you point out which file I should look at? I searched around and it looks like each file in `offsets/` is very specific to test certain aspect of the offset.
Also, do you have insights to the current failed tests `TestDataFrameSortIndex.test_sort_index_inplace` in CI? Seems unrelated to this PR.
cc @jbrockmendel if you can have a look.
> can you check if the docs need updating https://pandas.pydata.org/pandas-docs/dev/user_guide/timeseries.html#time-date-components or similar

@jreback I checked that the time-date component still cannot be accessed with addition from this PR. In the `DateOffset` section below, there's no mentioning of the parameters for the generic `DateOffset` object. However, I did noticed in this section there's no mentioning of the usage of replacing certain component of the timestamp with `DateOffset`, and I made a small addition to the paragraph and the example.
Apologies @jreback , things caught up and this PR fell behind. Is this PR ready to go?
@isVoid i think some actual tests are failing as well (ci is have *some* issues) but only codecov on 2 builds.
Got it. I think from https://github.com/pandas-dev/pandas/pull/43598#discussion_r739552299, the tests are failing because constructing `DateOffset` with `millisecond` is not supported yet. What's the convention to fail for yet-to-be-supported items in pandas test? I opted for pytest.skip here but checking to see if there's a better option.
this is worthile but needs to be passing, and pls merge master
@isVoid if you can move the note to 1.5 and merge master
@jreback done
status here?
@jreback just responded the most recent review message above. (And applied changes).
@isVoid if you can merge master and get this passing
@jreback Merged and checks passing.
https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=74993&view=logs&j=beebc4e0-08c3-587a-a9f8-8370dd8c77d0&t=4e13e18d-382c-5754-9d84-b74ae5d60514&l=119

This failure seems unrelated to this PR?
@isVoid can you merge master
thanks @isVoid for sticking with it!