Skip to content

Commit

Permalink
fix: Allow multiple values for arguments by skipping duplicates in fl…
Browse files Browse the repository at this point in the history
…yte_entity_call_handler
  • Loading branch information
dalaoqi committed Dec 13, 2024
1 parent 0c0476e commit eb2e549
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion flytekit/core/promise.py
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ def flyte_entity_call_handler(
# Convert args to kwargs
for arg, input_name in zip(args, entity.python_interface.inputs.keys()):
if input_name in kwargs:
raise AssertionError(f"Got multiple values for argument '{input_name}' in function '{entity.name}'")
continue
kwargs[input_name] = arg

ctx = FlyteContextManager.current_context()
Expand Down
7 changes: 0 additions & 7 deletions tests/flytekit/unit/core/test_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -1065,10 +1065,3 @@ def t1(a: int) -> int:
with pytest.raises(AssertionError, match="Received more arguments than expected"):
t1(1, 2)

def test_both_positional_and_keyword_args_task_raises_error():
@task
def t1(a: int) -> int:
return a

with pytest.raises(AssertionError, match="Got multiple values for argument"):
t1(1, a=2)

0 comments on commit eb2e549

Please sign in to comment.