flytekit icon indicating copy to clipboard operation
flytekit copied to clipboard

support None type in pyflyte run command

Open 0yukali0 opened this issue 2 months ago • 2 comments

Tracking issue

flyteorg/flyte#6717

Why are the changes needed?

pyflyte command supports strong typing in pipeline and allow users to set the parameters by --var. Supported None type make users set the None type or other values in their willing.

What changes were proposed in this pull request?

pyflyte run command parse None string to None type if type of parameter is Optional type. pyflyte run --remote command parse None string to None type whether type of parameter is Optional type.

How was this patch tested?

# pyflyte run main.py hello --name None
# pyflyte run --remote main.py hello --name None

import flytekit as fl
from typing import Optional

@fl.task()
def hello(name: Optional[int] = None):
    print(name)

Setup process

  1. flytectl demo start
  2. uv venv -p 3.12
  3. uv pip install flytekit
  4. pyflyte run main.py hello --name None
  5. pyflyte run --remote main.py hello --name None

Screenshots

  1. Local mode image

  2. Remote mode image

  3. UI image

Check all the applicable boxes

  • [x] I updated the documentation accordingly.
  • [x] All new and existing tests passed.
  • [x] All commits are signed-off.

Related PRs

Docs link

Summary by Bito

  • This pull request introduces support for the None type in parameter handling within the pyflyte command, allowing users to specify None as a valid input for optional parameters.
  • The changes ensure consistent behavior across both local and remote execution scenarios.
  • This update is crucial for users who need to pass None values explicitly in their workflows.
  • Overall summary: introduces support for None type in parameter handling, affecting local and remote execution.

0yukali0 avatar Nov 05 '25 05:11 0yukali0

Bito Automatic Review Skipped - Draft PR

Bito didn't auto-review because this pull request is in draft status.
No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type /review in a comment and save.
You can change draft PR review settings here, or contact your Bito workspace admin at [email protected].

flyte-bot avatar Nov 05 '25 14:11 flyte-bot

Codecov Report

:x: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 46.47%. Comparing base (3aebd23) to head (1452391).

Files with missing lines Patch % Lines
flytekit/interaction/click_types.py 0.00% 5 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3348      +/-   ##
==========================================
- Coverage   47.70%   46.47%   -1.23%     
==========================================
  Files         216      216              
  Lines       22692    22626      -66     
  Branches     2972     2972              
==========================================
- Hits        10825    10516     -309     
- Misses      11289    11588     +299     
+ Partials      578      522      -56     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Nov 06 '25 10:11 codecov[bot]