-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fix part of #12912: Changes deprecated python methods #14506
Conversation
Hi @vojtechjelinek, @seanlip -- could one of you please add the appropriate changelog label to this pull request? Thanks! |
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! Left two comments.
core/tests/test_utils.py
Outdated
sig = inspect.signature(self._func) | ||
|
||
args_dict = sig.bind_partial(*args, **kwargs) |
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.
Why this change?
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.
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.
Okay, could you then do
sig = inspect.signature(self._func) | |
args_dict = sig.bind_partial(*args, **kwargs) | |
sig = inspect.signature(self._func) | |
args_dict = sig.bind_partial(*args, **kwargs) |
and add an explanatory comment above it explaining what this code does.
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!
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.
Sorry, but I made a mistake here as this would not be the correct way to replace inspect.getcallargs( ). The method getcallargs() returns a dict while bind_partial( ) returns BoundArguments. This test is failing due to this issue.
I searched for the valid solution of this issue but could not find any satisfactory solution except these lines of code which use bind( ) to return dict.
However I am not sure of this and open to suggestions.
This error didn't show up in my localmachine. I am sorry if I caused any troubles.
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.
@vojtechjelinek PTAL
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.
@vojtechjelinek Can you please help here?
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.
@IamEzio Hey look at this https://docs.python.org/3/library/inspect.html#inspect.BoundArguments, the structure of BoundArguments
is explained there, from this you should be able to change the code.
Unassigning @vojtechjelinek since the review is done. |
Hi @IamEzio, it looks like some changes were requested on this pull request by @vojtechjelinek. PTAL. Thanks! |
@vojtechjelinek PTAL! Thanks |
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.
LGTM!
Unassigning @iamprayush since they have already approved the PR. |
Hi @DubeySandeep, this PR is ready to be merged. Author of this PR does not have permissions to merge this PR. Before you merge it, please make sure that there are no pending comments that require action from the author's end. Thanks! |
Hi @IamEzio, there is a new change in develop which needs to be in your PR. Please update your branch with the latest changes in develop. For instructions, refer to this link. Thanks! |
@vojtechjelinek Can you please reply on this thread? |
@DubeySandeep PTAL! I refactored the code which solved this failing backend test. |
Overview
Essential Checklist
Proof that changes are correct
PR Pointers