-
-
Notifications
You must be signed in to change notification settings - Fork 141
resolving issue 1162 I change Hashable to HashableT in _LocIndexerFrame and it'… #1165
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
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 please add a test based on the example in #1162 ?
This PR addresses the issue in #1162, where DataFrame.loc[] should accept a list[str] for indexing. To validate this behavior, I have written a test that:
Test Details: Asserts that the result is a DataFrame. The test passed successfully, confirming that DataFrame.loc[] behaves as expected with a list of strings. result:
is that okay? |
Your test should follow the pattern (and be included) in See the function |
I’ve added the test_loc_list_str function to verify that DataFrame.loc[] works as expected when using a list of strings for indexing. Please let me know if this works for you! |
precommit is failing because you didn't format with black See https://github.com/pandas-dev/pandas-stubs/blob/main/docs/setup.md to set up your environment. |
…ist of str's and instlled pre-commit
I've installed precommit and made the commit again. |
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 @shirzady1934
This PR resolves pandas-dev/pandas-stubs#1162 by replacing Hashable with HashableT in _LocIndexerFrame. I also verified the changes using mypy:
assert_type()
to assert the type of any return value