Repository navigation
MAINT: avoid pandas FutureWarning by checking specific condition - #5260
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5260 +/- ##
==========================================
+ Coverage 81.71% 81.71% +<.01%
==========================================
Files 569 569
Lines 89699 89706 +7
Branches 10028 10029 +1
==========================================
+ Hits 73294 73306 +12
+ Misses 14132 14129 -3
+ Partials 2273 2271 -2
Continue to review full report at Codecov.
|
|
where do you see those FutureWarnings? I cannot find any Add a link to the test log as reference in cases like this. |
|
I'm not seeing it in the CI logs either, will look for it locally. For the time being, the blockquote above will have to do. |
|
I've confirmed that this warning is not hit in the test suite, leaving a couple of possibilities for where I saw it. I'm not ready to rule out "incredibly specific dream" There are, however, cases where Regardless, this remains an improvement. |
|
OK, it looks like this is happening downstream in sm2 where MNLogit has been patched to fix wrapping. As part of this, model.endog_names is a pd.Index instead of a just "y", and as a result that gets passed to iolib.summary in result.summary() |
Noticed in test logs:
Cell.__init__currently uses a try/except to duck-type the check for anotherCellobject being passed asdata. In the case where a pandas Index is passed, the try/except works correctly, but not before issuing a warning.This PR changes the try/except check to a specific check for the relevant case, avoiding the FutureWarning.