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

CLN: removed setter method of categorical's ordered attribute #13671

Closed

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Jul 16, 2016

Deprecated back in 0.16.0 here.

@gfyoung gfyoung force-pushed the cat-set-order-removal branch from 80e1c71 to be61103 Compare July 16, 2016 07:42
@codecov-io
Copy link

codecov-io commented Jul 16, 2016

Current coverage is 84.38%

Merging #13671 into master will increase coverage by <.01%

@@             master     #13671   diff @@
==========================================
  Files           142        142          
  Lines         51223      51220     -3   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits          43223      43221     -2   
+ Misses         8000       7999     -1   
  Partials          0          0          

Powered by Codecov. Last updated by d7c028d...58938e7

@sinhrks sinhrks added Categorical Categorical Data Type Clean labels Jul 16, 2016
@sinhrks sinhrks added this to the 0.19.0 milestone Jul 16, 2016
@@ -808,14 +808,6 @@ def test_set_ordered(self):
cat2.set_ordered(False, inplace=True)
self.assertFalse(cat2.ordered)

# deperecated in v0.16.0
with tm.assert_produces_warning(FutureWarning):
cat.ordered = False
Copy link
Member

Choose a reason for hiding this comment

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

Pls change it to check AttributeError is raised.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@gfyoung gfyoung force-pushed the cat-set-order-removal branch from be61103 to 58938e7 Compare July 16, 2016 19:36
@gfyoung
Copy link
Member Author

gfyoung commented Jul 16, 2016

@sinhrks : added the test to check for AttributeError, and Travis still passing. Ready to merge if there are no other concerns.

@jreback
Copy link
Contributor

jreback commented Jul 19, 2016

thanks!

side note, can you catch these warnings (prob need to fix code to not have them emitted).

[Mon Jul 18 21:44:13 ~/pandas]$ nosetests  pandas/tests/test_categorical.py
........................................................../Users/jreback/pandas/pandas/core/internals.py:1493: FutureWarning: reshape is deprecated and will raise in a subsequent release. Please use .values.reshape(...) instead
  mask = mask.reshape(new_values.shape)
....................................................../Users/jreback/pandas/pandas/tests/test_categorical.py:4125: FutureWarning: 
Setting NaNs in `categories` is deprecated and will be removed in a future version of pandas.
  cat_exp = Categorical(["a", "b", "a"], categories=["a", "b", np.nan])
....................../Users/jreback/pandas/pandas/indexes/category.py:130: FutureWarning: 
Setting NaNs in `categories` is deprecated and will be removed in a future version of pandas.
  data = data.set_categories(categories)
.
----------------------------------------------------------------------
Ran 135 tests in 1.215s

OK

@gfyoung gfyoung deleted the cat-set-order-removal branch July 19, 2016 02:07
@gfyoung
Copy link
Member Author

gfyoung commented Jul 19, 2016

@jreback : probably something in the code would be the better fix in the future, but catching them makes sense FTTB. If I have time later, I'll give it a shot.

@jreback
Copy link
Contributor

jreback commented Jul 19, 2016

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Clean
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants