<#5491 [BUG] Missing inputs when using datetime.da...
# flytekit
a
#5491 [BUG] Missing inputs when using datetime.date type hint. Issue created by dansola Describe the bug When using
datetime.date
as a type hint in a task, flyte appears to lose the input file:
Copy code
FileNotFoundError: Failed to convert inputs of task 'wf.hello_date':
  [Errno 2] No such file or directory: '/var/folders/yv/l9q99njs4x35fp3x2_g8gykh0000gn/T/flyte-3c_0m7fn/raw/4f3290e595dcb84915aa481e45b92074/1f3c185c4a74647a397e5ca43ddcb5b3'
Expected behavior Flyte should recognize the
datetime.date
object the same way it recognizes the
datetime
object. Additional context to reproduce Good example:
Copy code
@task
def hello_date(date: datetime):
    print(f"Today is {str(date)}")

@workflow
def wf(date: datetime):
    hello_date(date=date)
pyflyte run --remote -p daniel date_bug/wf.py wf --date "2024-01-03"
This has no errors and works as expected. Bad example:
Copy code
@task
def hello_date(date: datetime.date):
    print(f"Today is {str(date)}")

@workflow
def wf(date: datetime.date):
    hello_date(date=date)
pyflyte run --remote -p daniel date_bug/wf.py wf --date "2024-01-03"
This results in the error:
Copy code
FileNotFoundError: Failed to convert inputs of task 'wf.hello_date':
  [Errno 2] No such file or directory: '/var/folders/yv/l9q99njs4x35fp3x2_g8gykh0000gn/T/flyte-3c_0m7fn/raw/4f3290e595dcb84915aa481e45b92074/1f3c185c4a74647a397e5ca43ddcb5b3
Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte