Skip to content

TST: check internal Categorical #13249

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
wants to merge 1 commit into from

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented May 21, 2016

@sinhrks sinhrks added Testing pandas testing functions or related to the test suite Categorical Categorical Data Type labels May 21, 2016
@sinhrks sinhrks added this to the 0.18.2 milestone May 21, 2016
@@ -685,8 +687,8 @@ def _check_types(l, r, obj='Index'):
assert_class_equal(left, right, exact=exact, obj=obj)
assert_attr_equal('dtype', l, r, obj=obj)
# allow string-like to have different inferred_types
if l.inferred_type in ('string', 'unicode'):
assertIn(r.inferred_type, ('string', 'unicode'))
if l.inferred_type in ('string', 'unicode', 'mixed'):
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, you sure about this? 'mixed' could be lots of things, even an integer & string will trigger.

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, this is no longer required. Removed (originally tried to handle .categories contains NaN).

@sinhrks sinhrks force-pushed the test_categorical branch from e42c088 to 46739a9 Compare May 21, 2016 15:04
@@ -253,9 +253,11 @@ def test_unstack_fill(self):
# By default missing values will be NaN
result = data.unstack()
expected = DataFrame({'a': pd.Categorical(list('axa'),
categories=list('abc')),
Copy link
Contributor

Choose a reason for hiding this comment

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

so we explicity force these to ordered? (or is it starting with an ordered cat)? this seems odd.

@sinhrks sinhrks force-pushed the test_categorical branch 2 times, most recently from 2dae9e8 to 9d5a577 Compare May 21, 2016 21:00
@sinhrks sinhrks force-pushed the test_categorical branch from 9d5a577 to f536644 Compare May 21, 2016 21:25
@jreback jreback closed this in 82bdc1d May 21, 2016
@jreback
Copy link
Contributor

jreback commented May 21, 2016

thanks @sinhrks

@sinhrks sinhrks deleted the test_categorical branch May 22, 2016 01:29
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.

TST: assert_series/frame not comparing for categoricals
2 participants