worried-iron-1001
12/10/2024, 9:51 PMworried-iron-1001
12/10/2024, 9:51 PM@task # type: ignore[misc]
def current_time_task(name: str) -> str:
"""Dummy task which prints current time."""
current_time = datetime.datetime.now(datetime.timezone.utc)
task_output = f"Hello, {name}! This is my task running at {current_time}"
<http://logger.info|logger.info>(task_output)
raise ValueError("Fail!")
return task_output
@task
def failure_cb(name: str, err: FlyteError | None) -> str:
print(f"Handling error: {err}")
return name
@workflow(on_failure=failure_cb) # type: ignore[misc]
def dummy_workflow(name: str) -> str:
"""Dummy workflow."""
return current_time_task(name=name) # type: ignore[no-any-return]
worried-iron-1001
12/10/2024, 9:51 PMHandling error: None
best-oil-18906
12/11/2024, 8:54 AMworried-iron-1001
12/11/2024, 4:25 PM-def failure_cb(name: str, err: FlyteError | None) -> str:
+def failure_cb(name: str, err: typing.Optional[FlyteError] = None) -> str: # noqa: UP007
print(f"Handling error: {err}")
return name
I changed to Optional, still same error.worried-iron-1001
12/12/2024, 12:33 AMaverage-finland-92144
01/02/2025, 4:31 PMworried-iron-1001
01/07/2025, 1:26 AMfreezing-airport-6809
freezing-airport-6809
webhook
notifications as a taskfreezing-airport-6809