jpuris
06/05/2024, 10:51 AMfrom prefect import flow, get_run_logger
from prefect.states import Failed
@flow
def my_flow():
logger = get_run_logger()
logger.error(
"Incremental replication was requested, but "
"the metadata table does not exist"
)
return Failed(msg="Missing metadata record for incremental replication")
Output looks like so
...
12:41:27.267 | ERROR | Flow run 'lemon-firefly' - Incremental replication was requested, but the metadata table does not exist
12:41:27.282 | ERROR | Flow run 'lemon-firefly' - Finished in state Failed()
Traceback (most recent call last):
... <lots of text!>
prefect.exceptions.FailedRun: Run failed.
I would like to remove the stack trace as it is unnecessary and adds confusion 😞flapili
06/05/2024, 12:09 PMjpuris
06/05/2024, 12:26 PM