-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Excel Tests Continued Fixture Cleanup #26662
Conversation
pandas/tests/io/test_excel.py
Outdated
@@ -58,8 +51,9 @@ def ignore_xlrd_time_clock_warning(): | |||
yield | |||
|
|||
|
|||
@td.skip_if_no('xlrd', '1.0.0') | |||
class ReadingTestsBase: | |||
@td.skip_if_no('xlrd') |
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.
Note that our project-wide minimum ix 1.0.0, so this decorator was being duplicative.
This decorator also won't be there in the long term once we completely couple TestReaders from xlrd, but keeping here for now
This was causing failures for me locally per this convo: Let's see what happens here... |
Codecov Report
@@ Coverage Diff @@
## master #26662 +/- ##
==========================================
- Coverage 91.87% 41.78% -50.1%
==========================================
Files 174 174
Lines 50663 50663
==========================================
- Hits 46548 21168 -25380
- Misses 4115 29495 +25380
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26662 +/- ##
==========================================
- Coverage 91.78% 91.77% -0.01%
==========================================
Files 174 174
Lines 50703 50703
==========================================
- Hits 46538 46534 -4
- Misses 4165 4169 +4
Continue to review full report at Codecov.
|
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.
OK think I'm stopping here. This should be a pretty good cleanup to remove unnecessary fixturation.
I think after this going to align the engine / ext usage in the Writer classes and can start splitting into sub-modules thereafter
@@ -80,7 +83,6 @@ def df_ref(self): | |||
parse_dates=True, engine='python') | |||
return df_ref | |||
|
|||
@td.skip_if_no("xlrd", "1.0.1") # see gh-22682 |
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.
These didn't really solve the issue they were supposed to so removed to make things cleaner. Again I think the real issue occurs when defusedxml is installed in the right environment, but will have to delve further into which environments that is exactly (orthogonal to this PR)
@@ -844,7 +841,7 @@ def test_read_excel_squeeze(self, ext): | |||
tm.assert_series_equal(actual, expected) | |||
|
|||
|
|||
@td.skip_if_no('xlrd', '1.0.0') | |||
@td.skip_if_no('xlrd') |
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.
Comment might have been lost on a prior PR but the min xlrd version for pandas is 1.0.0 anyway, so this was duplicative
lgtm. @simonjayhawkins |
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.
@WillAyd generally lgtm. a few suggestions.
@WillAyd changes look good. test failure is a mystery to me at the moment. I would say it was unrelated if it wasn't for the fact that no other builds are seeing this. the failing test has an engine parameter. coincidence? no reason that changes to test_excel should affect this test. test output shows the parametrisation of the engine fixture in pandas\tests\computation\test_eval.py does look iffy though. |
Yea no rush to merge I’ll take a look and maybe merge master. Seems unlikely but a clash in fixture naming could be possible.
…Sent from my iPhone
On Jun 7, 2019, at 5:31 AM, Simon Hawkins ***@***.***> wrote:
@WillAyd changes look good.
test failure is a mystery to me at the moment. I would say it was unrelated if it wasn't for the fact that no other builds are seeing this.
the failing test has an engine parameter. coincidence? no reason that changes to test_excel should affect this test. test output shows engine = 'numexpr' so implies no clash of fixtures.
the parametrisation of the engine fixture in pandas\tests\computation\test_eval.py does look iffy though.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
i think the engine bit may be a coincidence. it appears that a few tests are using set_use_numexpr which is messing with global variables instead of monkeypatching. so if the order of tests change, could be any unrelated changes, this could cause a problem. as an experiment, you could try changing the engine fixture in pandas\tests\computation\test_eval.py to
so that the skip is evaluated at test execution instead of during test collection since skipping depends on the global variable. |
Makes sense and I think what you have is more readable anyway. Just pushed |
i have a suspicion that'll probably not work because the test is quite involved so there will still be lag between checking the global and performing the failing op. not sure how much time you want to spend on this. could just revert the last couple of commits for now. i've had a go a parametrising the tests to split them up. but it may be easier to just debug the test on ci by adding print statements.
|
OK yea let me revert the last few changes then. Even if it passes CI somewhat fragile and orthogonal anyway. PR is big enough as is so happy to address separately and in coordination with whatever you are looking at |
950b695
to
7fc3f76
Compare
Thanks for the review @simonjayhawkins |
Follow up to #26579
Removing the frame2 fixture which is sparsely used. I've also removed inheritance of
ReadingTestsBase
and made that it's own discoverable class. Previously these tests were only being generated whenTestXlrdReader
was being run which tightly couples reading with xlrd.The goal here in subsequent PRs would be to better parametrize
TestReaders
for new engines that come in and truly makeTestXlrdReader
only deal with xlrd specific tests (will have to move around some tests to make that happen)