-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
DEPR: Deprecate pandas.datetime #30489
DEPR: Deprecate pandas.datetime #30489
Conversation
Hello @ryankarlos! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-01-02 02:08:34 UTC |
0dd69b7
to
32af092
Compare
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 for the PR - left a few minor comments
32af092
to
b45a47d
Compare
fc08438
to
15d6e12
Compare
15d6e12
to
624f2de
Compare
having some issues with adding this Datetime class for py36 - was trying to keep it consistent with the way np is handled - i get an error when trying to call pd.datetime in the test - can do pd.datetime.datetime although then there is the problem of warning not been generated due to _getattr not being accessedd correctly. Also, original issue i had linked this PR with is now closed - do i need to open a new one for datetime ? |
84f1451
to
54ce63e
Compare
@ryankarlos |
Yes please - and link the original issue. Also now that #30386 has been merged the implementation could be simplified - similar to what we do for SparseSeries/SparseDataFrame. Also can you merge master + take a look at test failures. 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.
Nice change, just a minor thing.
You'll have to fix the conflicts too.
try: | ||
return getattr(self.np, item) | ||
except AttributeError: | ||
raise AttributeError(f"module numpy has no attribute {item}") | ||
|
||
np = __numpy() | ||
|
||
class __Datetime: |
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.
Why two underscores instead of one?
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 was just to make it consistent with how __numpy() was being used - same for get__attr as thats how its used in pandas/tests/api/test_api.py::TestPDApi::test_depr
but i can revert if still needed
pandas/__init__.py
Outdated
|
||
def __getattr__(self, item): | ||
self.warnings.warn( | ||
"The pandas.datetime module is deprecated " |
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.
same as before
38c5ea7
to
e3b6fcf
Compare
@alimcmaster1 @datapythonista all green now - think ive addressed the required changes. |
very nice @ryankarlos thanks! |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff