<#3204 fix: remote-task doesn't support boolean Fa...
# flyte-github
c
#3204 fix: remote-task doesn't support boolean False Pull request opened by taieeuu ## Tracking issue issue 6311 ## Why are the changes needed? When executing the command pyflyte run remote-task example.example_task --no-flag, the error TypeTransformerFailedError: Python value cannot be None occurred. ## What changes were proposed in this pull request? In flytekit/interaction/click_types.py at line 527, the code forcibly returns None, causing subsequent conversion failures. Moreover, when running the command pyflyte run --remote example.py example_task --no-flag, the program then checks if the parameter is of boolean type and assigns it a value of False, as implemented in flytekit/clis/sdk_in_container/run.py at line 696.. Furthermore, I'm not sure whether it would be better to return value here. ## How was this patch tested?
Copy code
from flytekit import task
from click.testing import CliRunner
import os
from flytekit.clis.sdk_in_container import pyflyte


@task()
def example_task(flag: bool) -> bool:
    return flag

if __name__ == "__main__":

    runner = CliRunner()
    path = os.path.realpath(__file__)
    result = runner.invoke(pyflyte.main, ["run", "remote-task", "example.example_task", "--no-flag"])
    print("Remote Execution: ", result.output)
[image](https://private-user-images.githubusercontent.com/139771199/424582498-f186a4c0-0330-4527-8a11-28ca5c150a89.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDI2MzEwMzEsIm5iZiI6MTc0MjYzMDczMSwicGF0aCI6Ii8xMzk3NzExOTkvNDI0NTgyNDk4LWYxODZhNGMwLTAzMzAtNDUyNy04YTExLTI4Y2E1YzE1MGE4OS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMzIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDMyMlQwODA1MzFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jYTM3NzJmOTY0YjkwMzczMzAxMTk2NThiNmQ0NTBkM2IxZjg2ZjMzNDBmM2U2ZTY2ZTM0ODJiYzA4ZTI4M2VjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.11O1I5g-xFXIue1jTJeNy0DvzvvyGVCGVYpcI40rvr8) ### Setup process ### Screenshots ## Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. ## Related PRs ## Docs link ### Summary by Bito This PR fixes a bug in remote-task execution by correcting a faulty boolean assignment in flytekit/remote/remote.py and enhances test coverage for boolean parameter handling. It adds imports and test cases that verify both provided and omitted boolean flags, ensuring proper processing of boolean parameters without type conversion errors. Unit tests added: True Estimated effort to review (1-5, lower is better): 1 flyteorg/flytekit