Skip to content
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: Fix extra keyword args #174

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/julep/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ def patched_method(*args: P.args, **kwargs: P.kwargs):
bound_args.apply_defaults()

# Separate extra keyword arguments
extra_kwargs = {}
for key in list(bound_args.arguments.keys()):
if key not in allowed_kwargs and key not in params:
# This key is neither in allowed_kwargs nor a positional argument
extra_kwargs[key] = bound_args.arguments.pop(key)
extra_kwargs = {k: v for k, v in kwargs.items() if k not in allowed_kwargs and k not in params}

# If there are extra keyword arguments, merge them into 'extra_body'
if extra_kwargs:
Expand Down