Skip to content

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

Merged
merged 6 commits into from
Nov 11, 2022
Merged

added pd.Index with tests in common.pyi #422

merged 6 commits into from
Nov 11, 2022

Conversation

ramvikrams
Copy link
Contributor

@ramvikrams
Copy link
Contributor Author

Sir I had one doubt should the script test/nighly should be changed so that it's upgrades automatically for newer version of pip

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Nov 10, 2022

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.

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)
Copy link
Collaborator

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done the changes sir

Copy link
Collaborator

@Dr-Irv Dr-Irv left a 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



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)
Copy link
Collaborator

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

@ramvikrams
Copy link
Contributor Author

One small change - you duplicated one test. Otherwise looks good

Yes sir I'll fix it

@ramvikrams
Copy link
Contributor Author

Done the change sir

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

Thanks @ramvikrams

@Dr-Irv Dr-Irv merged commit db3b883 into pandas-dev:main Nov 11, 2022
@ramvikrams
Copy link
Contributor Author

Thanks @ramvikrams

Thanks sir

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

Successfully merging this pull request may close these issues.

is_numeric_dtype not considering Index as a valid type
2 participants