<#6473 [BUG] is_none() does not work with list inp...
# flyte-github
c
#6473 [BUG] is_none() does not work with list inputs as conditionals Issue created by marcstern14 ### Describe the bug
is_none()
throws an error when trying to evaluate if an indexed list item is
None
inside of a conditional. The error below is reproducible from the code excerpt in the additional context.
Copy code
AttributeError: 'NoneType' object has no attribute 'union'
This error is caused from a much more complex pipeline that is doing the same thing:
Copy code
Error 0: Code: ValueRequired, Node Id: n1, Description: Value required [RightValue.Val].
### Expected behavior Lists with
None
values should be able to be evaluated without typing or attribute issues. ### Additional context to reproduce
Copy code
from typing import Optional, Union
from flytekit import conditional, task, workflow

@task
def check_status() -> list[Optional[bool]]:
    return [None, True]

@task
def success_task() -> str:
    return "Task succeeded"

@task
def failure_task() -> str:
    return "Task failed"

@workflow
def wf() -> Optional[Union[str, bool]]:
    status = check_status()[0]
    return (
        conditional("status_check")
        .if_(status.is_none())
        .then(success_task())
        .else_()
        .then(failure_task())
    )
    
if __name__ == '__main__':
    result = wf()
    print(result)
### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte