Skip to content

Commit f6c228b

Browse files
committed
simplified method call, no need to pass first arg separately from *args
1 parent 1ca951e commit f6c228b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas_flavor/register.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def __call__(self, *args, **kwargs):
3232
method_call_obj = cb_create_call_stack_context_manager(method.__name__, args, kwargs) if cb_create_call_stack_context_manager else nullcontext()
3333
with method_call_obj:
3434
if not isinstance(method_call_obj, nullcontext):
35-
new_args, new_kwargs = method_call_obj.handle_start_method_call(self._obj, method.__name__, method_signature, args, kwargs)
35+
all_args = tuple([self._obj] + list(args))
36+
new_args, new_kwargs = method_call_obj.handle_start_method_call(method.__name__, method_signature, all_args, kwargs)
3637
args = new_args[1:]; kwargs = new_kwargs
3738

3839
ret = method(self._obj, *args, **kwargs)
@@ -67,7 +68,8 @@ def __call__(self, *args, **kwargs):
6768
method_call_obj = cb_create_call_stack_context_manager(method.__name__, args, kwargs) if cb_create_call_stack_context_manager else nullcontext()
6869
with method_call_obj:
6970
if not isinstance(method_call_obj, nullcontext):
70-
new_args, new_kwargs = method_call_obj.handle_start_method_call(self._obj, method.__name__, method_signature, args, kwargs)
71+
all_args = tuple([self._obj] + list(args))
72+
new_args, new_kwargs = method_call_obj.handle_start_method_call(method.__name__, method_signature, all_args, kwargs)
7173
args = new_args[1:]; kwargs = new_kwargs
7274

7375
ret = method(self._obj, *args, **kwargs)

0 commit comments

Comments
 (0)