Hi team, I’m seeing a strange error with `flytekit...
# ask-the-community
j
Hi team, I’m seeing a strange error with
flytekit==1.10.1
I can’t use a date as an input type from the command line anymore. For example take this workflow (in file
workflows.example.py
) :
Copy code
from datetime import date
from flytekit import task, workflow


@task
def is_in_future(in_date: date) -> bool:
    return in_date > date.today()


@workflow
def check_date_wf(in_date: date) -> bool:
    return is_in_future(in_date=in_date)
Trying to run it with pyflyte using this command:
Copy code
pyflyte run workflows/example.py check_date_wf --in_date=2023-11-25
Results in this error:
Copy code
╭─ Error ─────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Invalid value for '--in_date': Failed to convert param: <Option in_date>, value: 2023-11-25 00:00:00 to type:   │
│ <class 'datetime.date'>. Reason Expected value of type <class 'datetime.date'> but got '2023-11-25 00:00:00' of │
│ type <class 'datetime.datetime'>                                                                                │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
How can I supply a
date
not a
datetime
here?
k
Uh ho- this could be a regression- cc @Kevin Su can you TALK at the click_types? Here is datetime https://github.com/flyteorg/flytekit/blob/a6f9991952f6f95a2de99cf187e0778f3abff4e8/flytekit/interaction/click_types.py#L109
Or cc @Samhita Alla
s