<#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.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDg1MzcwNjksIm5iZiI6MTc0ODUzNjc2OSwicGF0aCI6Ii8xMzk3NzExOTkvNDI0NTgyNDk4LWYxODZhNGMwLTAzMzAtNDUyNy04YTExLTI4Y2E1YzE1MGE4OS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwNTI5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDUyOVQxNjM5MjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03YTllNWQ0ODUxZjIyYjdhZjNhMTJjMDFlNjlhNmRmYWE3YjNjOWUzMzliOWJjMDcyZWUzNTE0ZWU3ZWNlODMxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.kdI0BqxZbtQuvH6O_f2yEENdoEkGHi0p8TvDzSXf3bM) ### 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 https://bito.ai#summarystart| ### Summary by Bito This pull request fixes a bug in remote-task execution by ensuring boolean parameters default to False instead of None, preventing type conversion errors. It also enhances the test suite to cover scenarios involving boolean flags for better validation and includes additional tests for boolean flag handling, improving the reliability of the functionality. flyteorg/flytekit