Skip to content
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

TST/CLN: empty DataFrames and some 'empty' Series #25690

Merged
merged 3 commits into from
Mar 27, 2019

Conversation

simonjayhawkins
Copy link
Member

xref #24886 (comment)

have included Series constructed with an empty dict.

Series constructed with an empty list, tuple or generator are not the same as Series() or Series({}), so have not included them in this pass. (although for many tests the difference in the Index is not relevant)

@codecov
Copy link

codecov bot commented Mar 12, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25690      +/-   ##
==========================================
+ Coverage   91.28%   91.28%   +<.01%     
==========================================
  Files         173      173              
  Lines       52965    52965              
==========================================
+ Hits        48348    48349       +1     
+ Misses       4617     4616       -1
Flag Coverage Δ
#multiple 89.86% <ø> (ø) ⬆️
#single 41.73% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/util/testing.py 89.08% <0%> (+0.09%) ⬆️

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 26d991f...c285290. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Mar 12, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25690      +/-   ##
==========================================
+ Coverage   91.28%   91.28%   +<.01%     
==========================================
  Files         173      173              
  Lines       52965    52965              
==========================================
+ Hits        48348    48349       +1     
+ Misses       4617     4616       -1
Flag Coverage Δ
#multiple 89.86% <ø> (ø) ⬆️
#single 41.73% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/util/testing.py 89.08% <0%> (+0.09%) ⬆️

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 26d991f...c285290. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 12, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25690      +/-   ##
==========================================
+ Coverage   91.47%   91.48%   +<.01%     
==========================================
  Files         175      175              
  Lines       52885    52885              
==========================================
+ Hits        48379    48380       +1     
+ Misses       4506     4505       -1
Flag Coverage Δ
#multiple 90.04% <ø> (ø) ⬆️
#single 41.82% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/util/testing.py 89.84% <0%> (+0.1%) ⬆️

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 95c78d6...05ab670. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Mar 13, 2019

this is fine. is it possible to have a code_checks rule to detect these (slightly tricky as you only want to disallow these in an assignment (and not a lambda).

@jreback jreback added Testing pandas testing functions or related to the test suite Clean labels Mar 13, 2019
@jreback jreback added this to the 0.25.0 milestone Mar 13, 2019
lambda: DataFrame(data=[]),
lambda: DataFrame(data=(x for x in [])),
# these are NOT empty DataFrames
pytest.param(lambda: DataFrame([[]]), marks=pytest.mark.xfail(
Copy link
Member

Choose a reason for hiding this comment

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

Better to parametrize these in a separate test rather than supplying mark here

Copy link
Member Author

Choose a reason for hiding this comment

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

I was just cautious of making actual behaviour tested and then tested behaviour becoming the accepted behaviour because it's tested. I'm not sure if the index differences are intentional.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah i agree, can you separate these cases out

Copy link
Contributor

Choose a reason for hiding this comment

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

can you update this and merge master, ping on green.

pandas/tests/series/test_constructors.py Show resolved Hide resolved
@jreback
Copy link
Contributor

jreback commented Mar 26, 2019

can you update

@simonjayhawkins
Copy link
Member Author

this is fine. is it possible to have a code_checks rule to detect these (slightly tricky as you only want to disallow these in an assignment (and not a lambda).

have not looked into this yet, will circle back round after revisiting my other open PRs.

@jreback jreback merged commit ac318d2 into pandas-dev:master Mar 27, 2019
@jreback
Copy link
Contributor

jreback commented Mar 27, 2019

thanks @simonjayhawkins

yeah if you can think of a nice way to add to code_checks would be great.

@simonjayhawkins simonjayhawkins deleted the empty-dataframes branch March 27, 2019 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants