-
-
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
cleaned up imports #18264
cleaned up imports #18264
Conversation
@jreback Why is it needed to use ABCMultiIndex instead of MultiIndex and move the DataFrame imports inline? There is no circular import here? |
Then I think we should put it back, but we should also open an issue at statsmodels that they should not do that (independently of whether we have that import there or not, they should never import from 'core') |
@jorisvandenbossche Looks like statsmodels has it fixed now. Edited: @TomAugspurger fixed this here: statsmodels/statsmodels@45e55d0#diff-a494553e88130577065e0b012246ca51 |
The problem is that they didn't yet do a new release. So for now I would not do any change that breaks a released version of statsmodels, as we are not sure at this point a new statsmodel release will be out before a new pandas release. |
Yes, that makes sense. But, pandas 0.22 won't come out for another 3+ months (where is the release schedule btw?) and statsmodels has been on 0.8 for 9 months now. Should we find out if they are going to release the next version before 0.22? |
Are you able to just import get_dummies in pandas.core.api, or does that
cause circular import issues? I wouldn't assume that statsmodels is going
to do a release before 0.22.
…On Mon, Nov 13, 2017 at 3:53 PM, Ted Petrou ***@***.***> wrote:
Yes, that makes sense. But, pandas 0.22 won't come out for another 3+
months (where is the release schedule btw?) and statsmodels has been on 0.8
for 9 months now. Should we find out if they are going to release the next
version before 0.22?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18264 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIo3Lqo9WK81S6WqD38DqkHHe1HaSks5s2LpqgaJpZM4QcJx7>
.
|
Codecov Report
@@ Coverage Diff @@
## master #18264 +/- ##
==========================================
+ Coverage 91.38% 91.38% +<.01%
==========================================
Files 164 164
Lines 49884 49884
==========================================
+ Hits 45584 45587 +3
+ Misses 4300 4297 -3
Continue to review full report at Codecov.
|
That is no problem, as we were only cleaning up imports in core/api.py that are not really necessary from pandas point of view (but thus used by statsmodels). So I mean easy to just not do the clean-up (yet) |
so test_downstream.py is failing? we test against the latest released versions of these packages I want to add a repro test with the statsmodels failure, then you can leave |
It's been fixed in statsmodels master, just not the released version.
…On Tue, Nov 14, 2017 at 5:17 AM, Jeff Reback ***@***.***> wrote:
@tdpetrou <https://github.com/tdpetrou>
There is one test failing. Statsmodels imports get_dummies from
pandas.core.api which is no longer possible. It should import directly from
pandas.
so test_downstream.py is failing?
I want to add a repro test with the statsmodels failure, then you can
leave get_dummies import in pandas.core.api, with a TODO to move later
(and we'll create an issue about it).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#18264 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIjsact-7pBl3mn2OPd30Z1I-IUhQks5s2XbDgaJpZM4QcJx7>
.
|
@TomAugspurger that's good, but our test should still fail; its against the released version. if its NOT failing, then our test is not good enough (maybe it doesn't import that code). |
@jreback Yes it was
|
@tdpetrou so this PR should be failing as the current code has the move of |
@jreback |
this is puzzling why this is not failing, going to test on another build, #18333 let's see. |
@tdpetrou go ahead and rebase, this should fail. |
Codecov Report
@@ Coverage Diff @@
## master #18264 +/- ##
==========================================
+ Coverage 91.38% 91.38% +<.01%
==========================================
Files 164 164
Lines 49790 49884 +94
==========================================
+ Hits 45501 45587 +86
- Misses 4289 4297 +8
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18264 +/- ##
==========================================
+ Coverage 91.35% 91.65% +0.29%
==========================================
Files 163 164 +1
Lines 49681 51487 +1806
==========================================
+ Hits 45386 47189 +1803
- Misses 4295 4298 +3
Continue to review full report at Codecov.
|
can you rebase 1 more time, I want to see this fail; the statsmodels test was being skipped. |
@jreback Did this fail correctly? |
Yes, it is correctly failing now. So you can now put it back in core/api.py @jreback can you answer my question above #18264 (comment) ? |
@jorisvandenbossche I put |
we use the ABC* for instance checking generally, these have no dependencies. This actually does have a conditional import, that's why its pandas.core.frame.DataFrame; we try to remove these and import inside the function as its much cleaner. |
thanks. ping on green. Can you make an issue to move this (on the pandas side, when statsmodels releases). |
@jreback I think this is good but circleci is failing? I'll keep a note to make an issue on the next statsmodels release |
thanks @tdpetrou
can you make an issue about this, we have 2 changes we need to make now (I'll edit with the other one) |
This is a continuation of #18148 and does the following
reshape
imports frompandas.core.api
topandas.core.reshape.api
pandas.core.dtypes.generic.ABCMultiIndex
inplace ofMultiIndex
inmelt.py
from pandas import DataFrame
inmelt.py
inside functionsThere is one test failing. Statsmodels imports
get_dummies
frompandas.core.api
which is no longer possible. It should import directly from pandas.