Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
positional and kwargs corner case fix in for _build_args_kwargs (pyto…
…rch#2714) Summary: ## Context: Setting None in positional args is colliding with the kwargs in situations when kwargs contains the argument name accepted by the method. Eg : ``` def input_dist(ctx, id_feature_list): ... // If _build_args_kwargs returns: args = [None] kwargs = {'id_feature_list': KJT} input_dist(ctx, *args, **kwargs) // extends to input_dist(ctx, None, id_feature_list=KJT) ``` which results in "TypeError: got multiple values for argument 'id_feature_list'" because id_feature_list is provided both positionally (None) and via kwargs. ## Fix: Ensure _build_args_kwargs does not append None to args when an argument is already correctly assigned in kwargs. Differential Revision: D68892351
- Loading branch information