-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
CLN: What is the purpose of datetools.py? #14094
Comments
xref #5886 yeah I think we had a discussion about this in the past. I think it is appropriate to deprecate this entire module, and point to I also suspect this is commonly imported by people, so better to put up the deprecation warning now. some of these might be reasonably for the public api, but that's another discussion. |
this is ATM an import to pandas itself, so need to remove that (and also from tests where it is). e.g. importing pandas should not generate this warning, only importing it directly should e.g. |
|
@jreback : I'm not entirely familiar with shimming. Explain? |
Also, I might that it seems this module does expose some objects that could be useful in the public API, but I agree they should be re-organised afterwards. |
like this: https://github.com/pydata/pandas/blob/master/pandas/core/common.py#L23 the idea is you can't directly affect
There might be a better way of doing this, to have anything from IIRC @njsmith has some magic code to do this. |
@jreback : But there are no functions to wrap here? They're a bunch of convenience objects. |
sure there are in core/datetools.py
can easily become
may need several mini versions of these to have the correct warning message (e.g. where to import from) |
Ah, that's a good point. |
Yep, I think it would be nice to deprecated it. But, we should decide on a proper namespacing for those things (as they are useful public methods/objects). But it seems it will be difficult to deprecate some of those. Because the objects that start with a lower character are actual instances and not functions/constructors (eg |
it's very odd that they r here to be honest we need an import hook to depreciate these I think or a proxy object that shows the deprecation when u use them (like I did with resample) or maybe just remove them |
these don't serve any purpose as they are just aggregates imports - I don't thing they should be put anywhere |
@jreback , @jorisvandenbossche : Why not just deprecate the module like we are doing with |
these are already imported into pd.datetools namespace |
https://github.com/njsmith/metamodule will do it |
Not sure if we need to go through all those of loops just for this. I suspect a thorough refactoring could do the trick IMO. |
not sure what that means - sure we can just drop the code but better to provide a deprecation |
Thorough refactoring, move all of these "convenience objects" to other locations, remove all internal references (e.g. tests), etc. |
of course and how do you propose to deprecate? |
Do what we did with |
and how is that going to work? the point is we need to intercept that access and provide a warning - shimming via wrapped functions or a meta module is necessary |
* MAINT: Replace datetools import in tests * MAINT: Replace datetools import internally * DOC: Replace datetools import in docs * MAINT: Remove datetool imports from scripts * DEPR: Deprecate pandas.core.datetools Closes gh-14094.
The doc-string at the top of datetools.py seems to indicate this is just a hodge-podge of datetime-related objects. Seems like that could be cleaned up unless there is good reason to have it.
The text was updated successfully, but these errors were encountered: