Skip to content

MAINT: Removed some warnings in tests #13702

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

Closed

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Jul 19, 2016

Per discussion with @jreback here.

@@ -2934,26 +2933,28 @@ def test_value_counts_with_nan(self):
s = pd.Series(pd.Categorical(["a", "b", "a"],
Copy link
Contributor

Choose a reason for hiding this comment

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

this is an incorrect construction, categories should not be nan by definition

Copy link
Member Author

Choose a reason for hiding this comment

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

The test is expecting a nan in the construction of the categories if you look at what it is testing.

Copy link
Contributor

Choose a reason for hiding this comment

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

and that's wrong

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, okay. Fair enough. Done.

@jreback jreback added Testing pandas testing functions or related to the test suite Categorical Categorical Data Type labels Jul 19, 2016
@jreback jreback added this to the 0.19.0 milestone Jul 19, 2016
@codecov-io
Copy link

codecov-io commented Jul 19, 2016

Current coverage is 84.52%

Merging #13702 into master will decrease coverage by <.01%

@@             master     #13702   diff @@
==========================================
  Files           141        141          
  Lines         51145      51145          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43233      43230     -3   
- Misses         7912       7915     +3   
  Partials          0          0          

Powered by Codecov. Last updated by 8acfad3...e7292d3

@gfyoung gfyoung force-pushed the test-warnings-remove branch from fd12eb3 to feecb8b Compare July 20, 2016 03:03
@gfyoung
Copy link
Member Author

gfyoung commented Jul 20, 2016

@jreback : it seems like test_categorical.py has A LOT of tests where they expect to use np.nan as a category. Does it make sense to modify / remove them?

@jreback
Copy link
Contributor

jreback commented Jul 20, 2016

can't be very many as we have a warning for it
I only see a few

@gfyoung
Copy link
Member Author

gfyoung commented Jul 20, 2016

  1. A Ctrl+F returns 30+ results (all of them caught with tm.assert_produces_warnings(FutureWarning)
    of course).
  2. So is that a yes or no?

@jreback
Copy link
Contributor

jreback commented Jul 20, 2016

there are warnings but should not be from that

pls show an example or 2

@gfyoung
Copy link
Member Author

gfyoung commented Jul 20, 2016

  1. Constructor tests here (just testing that duplicates get rejected)

  2. Describing with NaN categories here

  3. Another constructor test here.

  4. This entire test here.

  5. Setter tests here.

Perhaps I'm conflating unnecessary tests with backwards compat tests since the code still has to work with this deprecated behaviour, not sure...

@jreback
Copy link
Contributor

jreback commented Jul 20, 2016

yeah these are all fine
when this behavior is removed in the future the tests can be changed

for now since we have enough catching of the warning
prob just fix the examples that were causing a warning (rather than catch them)

@gfyoung
Copy link
Member Author

gfyoung commented Jul 20, 2016

Okay, sounds good. I'll fix the other one then.

@gfyoung gfyoung force-pushed the test-warnings-remove branch from feecb8b to e7292d3 Compare July 20, 2016 03:43
@gfyoung
Copy link
Member Author

gfyoung commented Jul 20, 2016

@jreback : Removed the previous warnings, and Travis is still passing. Ready to merge if there are no other concerns.

@jreback jreback closed this in 4962131 Jul 20, 2016
@jreback
Copy link
Contributor

jreback commented Jul 20, 2016

ty!

@gfyoung gfyoung deleted the test-warnings-remove branch July 21, 2016 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type 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