Skip to content

Excel Test Cleanup - ReadWriteClass #26473

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

Merged
merged 4 commits into from
May 24, 2019

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented May 20, 2019

The tests we have in this module need a pretty big refactor as they mix a few testing idioms together. This is slowing down contributions on items like #25092 and #25427

This is going to require quite a few PRs to get it where it needs to be. This one simply:

  • Moves tests that require both reading and writing into a dedicated class
  • Moves skip fixtures off of the SharedItems class onto the classes that actually use them

I'd eventually like to get rid of the SharedItems class and use parametrization on Reader/Writer classes to test the various combinations of engines and extensions, though again going to take a few PRs to get there

@WillAyd WillAyd added Testing pandas testing functions or related to the test suite IO Excel read_excel, to_excel Clean labels May 20, 2019
@codecov
Copy link

codecov bot commented May 20, 2019

Codecov Report

Merging #26473 into master will decrease coverage by 50.05%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #26473       +/-   ##
===========================================
- Coverage   91.75%    41.7%   -50.06%     
===========================================
  Files         174      174               
  Lines       50765    50765               
===========================================
- Hits        46578    21170    -25408     
- Misses       4187    29595    +25408
Flag Coverage Δ
#multiple ?
#single 41.7% <ø> (-0.11%) ⬇️
Impacted Files Coverage Δ
pandas/io/formats/latex.py 0% <0%> (-100%) ⬇️
pandas/io/sas/sas_constants.py 0% <0%> (-100%) ⬇️
pandas/core/groupby/categorical.py 0% <0%> (-100%) ⬇️
pandas/tseries/plotting.py 0% <0%> (-100%) ⬇️
pandas/tseries/converter.py 0% <0%> (-100%) ⬇️
pandas/io/formats/html.py 0% <0%> (-99.37%) ⬇️
pandas/io/sas/sas7bdat.py 0% <0%> (-91.16%) ⬇️
pandas/io/sas/sas_xport.py 0% <0%> (-90.1%) ⬇️
pandas/core/tools/numeric.py 10.14% <0%> (-89.86%) ⬇️
pandas/io/s3.py 0% <0%> (-89.48%) ⬇️
... and 129 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5cc078...5c30f32. Read the comment docs.

@codecov
Copy link

codecov bot commented May 20, 2019

Codecov Report

Merging #26473 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26473      +/-   ##
==========================================
- Coverage   91.75%   91.74%   -0.01%     
==========================================
  Files         174      174              
  Lines       50765    50765              
==========================================
- Hits        46578    46574       -4     
- Misses       4187     4191       +4
Flag Coverage Δ
#multiple 90.25% <ø> (ø) ⬆️
#single 41.72% <ø> (-0.09%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 97.02% <0%> (-0.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f5cc078...5c30f32. Read the comment docs.

@@ -60,6 +59,20 @@ def setup_method(self, datapath):
self.tsframe = _tsframe.copy()
self.mixed_frame = _mixed_frame.copy()


@td.skip_if_no('xlrd', '1.0.0')
class ReadingTestsBase(SharedItems):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might not be entirely apparent from the diff but to clarify here I've moved get_csv_refdf, get_excelfile and get_exceldf out of the SharedItems class because they were only used by the ReaderBaseClass.

What's left in SharedItems should be replaced by fixtures where needed in the next PR

@jreback jreback added this to the 0.25.0 milestone May 24, 2019
@jreback jreback merged commit b730ab3 into pandas-dev:master May 24, 2019
@jreback
Copy link
Contributor

jreback commented May 24, 2019

thanks @WillAyd cleanups for testing here very welcome!

another-green pushed a commit to another-green/pandas that referenced this pull request May 29, 2019
@WillAyd WillAyd deleted the excel-test-cleanup branch January 16, 2020 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean IO Excel read_excel, to_excel Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants