What would be the preferred way to fail the flow without printing the stack trace? E.g.
Copy code
from 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
Copy code
...
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 😞
f
flapili
06/05/2024, 12:09 PM
From what I saw in source code the display is hardcoded
j
jpuris
06/05/2024, 12:26 PM
That's unfortunate. I'll see if I have some time to open a PR little later on.
Thank you for checking!
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.