the task decorator has a task_run_name, which resu...
# ask-community
a
the task decorator has a task_run_name, which results in an error if
date
becomes a string Like this
Copy code
@task(task_run_name='{name}-{date:%FT%T}')                         
def say_hello(name):                                               
    logger = prefect.context.get("logger")                         
    <http://logger.info|logger.info>("Hello, %s!", name)                                
    <http://logger.info|logger.info>('Flow run name: %s', prefect.context.flow_run_name)
1
'{date!s:.19}'
did the trick
z
Glad you got it! Another option would be to use a function to create the task_run_name and parse the date using pendulum first.
👍 1