-
-
Notifications
You must be signed in to change notification settings - Fork 141
added pd.Index with tests in common.pyi #422
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
Conversation
Sir I had one doubt should the script test/nighly should be changed so that it's upgrades automatically for newer version of pip |
Just merged in #421 that fixes the nightly issue. So you can merge with latest master to fix that. |
tests/test_api_types.py
Outdated
assert_type(api.is_array_like(pd.DataFrame({"a": [1, 2], "b": [3, 4]})), bool), | ||
bool, | ||
) | ||
check(assert_type(api.is_array_like(pd.Index([1, 2.0])), bool), bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change all of these to use a module-level variable. Right now, we have at the top of this file:
nparr = np.array([1, 2, 3])
arr = pd.Series([1, 2, 3])
obj = "True"
mapping = {"a": "a"}
so you can add something for np.dtype(np.int32)
, (pd.DataFrame({"a": [1, 2], "b": [3, 4]})
and pd.Index([1, 2.0])
up top, and reuse those variables throughout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure sir i'll do it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done the changes sir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small change - you duplicated one test. Otherwise looks good
tests/test_api_types.py
Outdated
|
||
|
||
def test_is_categorical_dtype() -> None: | ||
check(assert_type(api.is_categorical_dtype(arr), bool), bool) | ||
check(assert_type(api.is_categorical_dtype(nparr), bool), bool) | ||
check(assert_type(api.is_categorical_dtype(dtylike), bool), bool) | ||
check(assert_type(api.is_categorical_dtype(arr), bool), bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is duplicate of a few lines above
Yes sir I'll fix it |
Done the change sir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ramvikrams
Thanks sir |
assert_type()
to assert the type of any return value