HI Folks, I am wondering if there is a good way to...
# flyte-support
g
HI Folks, I am wondering if there is a good way to rename a task? I have a few tasks (all decorated with
@task
) but I can't find a good way to rename them. We use the task name for some of our metrics but they are too long and I would like to shorten them
a
You can pass the name to the task decorator right? Below is the method signature:
Copy code
(method) def task(
    _func: Unknown | None = None,
    *,
    name: str | None = None,
    cache: CacheRequest | None = None,
    retries: int | RetryStrategy = 0,
    timeout: timedelta | int = 0,
    docs: Documentation | None = None,
    secrets: SecretRequest | None = None,
    pod_template: str | Unknown | None = None,
    report: bool = False,
    max_inline_io_bytes: int = MAX_INLINE_IO_BYTES
@env.task(name=xyz)
g
f
ohh in v1, you cannot rename a task, you can change module. you can rename the
runtime
node, which is what shows up in the graph. This can be done using
task.with_overrides(...
)