-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
BUG: Raise TypeError when subracting DateTimeArray and other date types #59901
BUG: Raise TypeError when subracting DateTimeArray and other date types #59901
Conversation
@rhshadrach - can you verify if my implementation here is correct? I'm not sure of this. A bit of guidance could be useful. Thanks |
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.
I think this is looking good, CI failures look unrelated. They'll be fixed outside of this PR.
pandas/core/arrays/datetimelike.py
Outdated
@@ -18,6 +18,7 @@ | |||
import warnings | |||
|
|||
import numpy as np | |||
import pandas |
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.
We shouldn't be importing pandas at the top of a module like this - it will cause import cycles. Search for where DatetimeArray
is imported in other parts of the code and follow those examples.
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.
In general, search what you want to import and see how other code does it.
grep --include \*.py -nre ".*import.*DatetimeArray"
pandas/core/ops/array_ops.py:535: from pandas.core.arrays import DatetimeArray
pandas/core/dtypes/dtypes.py:858: from pandas.core.arrays import DatetimeArray
pandas/core/dtypes/dtypes.py:944: from pandas.core.arrays import DatetimeArray
pandas/core/dtypes/astype.py:105: from pandas.core.arrays import DatetimeArray
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.
Thanks @rhshadrach, I have removed this
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.