Skip to content

Remove timeop #19277

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 4 commits into from
Jan 19, 2018
Merged

Remove timeop #19277

merged 4 commits into from
Jan 19, 2018

Conversation

jbrockmendel
Copy link
Member

We're finally able to remove ops._Op and ops._TimeOp. This PR makes one final compatibility fix:

ATM:

tdi = pd.TimedeltaIndex(['1 Day'])
ser = pd.Series(tdi)

>>> tdi + np.nan
TypeError: unsupported operand type(s) for +: 'TimedeltaIndex' and 'float'

>>> ser + np.nan
0   NaT
dtype: timedelta64[ns]

Same deal for subtracting np.nan. See #19274. This makes the TimedeltaIndex canonical and updates the appropriate Series tests.

@jreback jreback added Datetime Datetime data dtype Clean labels Jan 18, 2018

from pandas import compat
from pandas.util._decorators import Appender

from pandas.compat import bind_method
import pandas.core.missing as missing

from pandas.errors import PerformanceWarning, NullFrequencyError
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. are there any of these PerformanceWarnings uncaught?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure we got them all while implementing the Index versions of these ops.

@jreback jreback added this to the 0.23.0 milestone Jan 18, 2018
@jbrockmendel
Copy link
Member Author

Travis cancelled. Repush or let sit?

@jreback
Copy link
Contributor

jreback commented Jan 18, 2018

i restarted

@jbrockmendel
Copy link
Member Author

Looks like OSX build got killed again, otherwise OK

@jreback
Copy link
Contributor

jreback commented Jan 18, 2018

lgtm. just waiting on travis.

@jreback jreback merged commit f0cd23c into pandas-dev:master Jan 19, 2018
@jreback
Copy link
Contributor

jreback commented Jan 19, 2018

thanks.

now would be a good time to split the test_operators into sub-modules :>

@jbrockmendel jbrockmendel deleted the remove_timeop branch January 19, 2018 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Datetime|Timedelta)Index +/- np.nan
2 participants