-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: added type annotations and tests to check for multiple warning match #47833
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
shourya5
commented
Jul 23, 2022
- closes DOC: clarify that assert_produces_warning can take multiple warnings #47829
- Added type annotations to new arguments/methods/functions.
…es_warning function
@github-actions pre-commit |
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.
left some comments - could you address the linting errors too please?
this was removed not long ago (the stable docs will only update after the 1.5 release, but the dev docs already don't show it) - can you run it locally? Just
where you put any files you've modified after |
I am failing one test besides the pre-commit test |
You need to update the type annotation in _assert_caught_no_extra_warnings too |
Does this look correct? |
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.
Nice
Couple of things:
- the docstring of assert produces warning needs updating, can you add a line there about how to catch multiple warnings you can pass them as a tuple? Line 40, in the description of "expected warning"
- can you run pre-commit on the files you've modified?
the pre-commit action is changing 'Tuple' to tuple. Should I change it or leave it as is? |
Yeah that's fine, just git add, git commit, git push |
I think it should pass all tests now |
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.
Looks good to me, thanks @shourya5 !
…atch (pandas-dev#47833) * Testing * TST: added a test for multiple warnings * TYP: added type annotation Tuple[Type[Warning], ...] in assert_produces_warning function * TST: added a test for multiple warnings * TYP: Fixed Annotations * TST: Test for catching multiple warnings * TST: Test for catching multiple warnings * TST: Test for catching multiple warnings * TYP : fixed type annotations in _assert_caught_no_extra_warnings * TYP : updated type annotations * DOC : added issue as inline comment * DOC : added some documentation regarding type annotations * DOC : fixed pre-commit errors * fix missing whitespace Co-authored-by: Marco Edward Gorelli <[email protected]>