cuddly-jelly-27016
07/16/2025, 7:58 AMdict[str, list[str] | None] | None). Hower, when running such task on the cluster it works.
### Expected behavior
The behavior of local tests should be similar to the behavior on the cluster. optional dictionaries, with optional list values types should be supported.
### Additional context to reproduce
from flytekit import task
# Defining an optional dict with list[str] values works
@task
def basic_task(data: dict[str, list[str]] | None) -> None:
return
def test_basic_task():
result = basic_task(data={"key": ["value1", "value2"]})
assert result is None
# Defining an dict with optional list[str] values works
@task
def optional_task(data: dict[str, list[str] | None] ) -> None:
return
def test_optional_task():
result = optional_task(data={"key": ["value1", "value2"]})
assert result is None
# Defining an optional dict with optional list[str] values
# DOES NOT work locally, but it does work on a cluster
@task
def complex_task(data: dict[str, list[str] | None] | None) -> None:
return
def test_complex_task():
result = complex_task(data={"key": ["value1", "value2"]})
assert result is None
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
07/16/2025, 7:58 AM