-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Add milliseconds
field support for pd.DateOffset
#43598
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
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you will have to look thru the tests a bit more, but these don't test very much about this, eg. these test some ops, but these barely test that this works.
@jreback The old |
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 |
Also, do you have insights to the current failed tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test comment.
can you check if the docs need updating https://pandas.pydata.org/pandas-docs/dev/user_guide/timeseries.html#time-date-components or similar
cc @jbrockmendel if you can have a look. |
@jreback I checked that the time-date component still cannot be accessed with addition from this PR. In the |
@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 |
…teoffset_milliseconds
@jreback Merged and checks passing. |
This failure seems unrelated to this PR? |
@isVoid can you merge master |
thanks @isVoid for sticking with it! |
|
||
assert (self.d + DateOffset(months=2)) == datetime(2008, 3, 2) | ||
assert (self.d - DateOffset(months=2)) == datetime(2007, 11, 2) | ||
@pytest.mark.parametrize("relativedelta_kwd", list(liboffsets._relativedelta_kwds)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be list
-> sorted
to prevent pytest collection errors with pytest-xdist.
Also, for consistency with elsewhere in this module, could maybe also change "relativedelta_kwd" -> "kwd"?
milliseconds
field inDateOffset
#43371