https://prefect.io logo
s

Suresh R

01/24/2022, 6:10 PM
Hi,Below is my state handler snippet, i am getting error
'Running' object has no attribute 'is_success'
,can someone help.
Copy code
def post_to_cw(obj, old_state, new_state):
    if new_state.is_failed():
        cloudwatch.put_metrics(cid=CID, flow_name=FLOW_NAME, status_code=1)
    if new_state.is_success():
        cloudwatch.put_metrics(cid=CID, flow_name=FLOW_NAME, status_code=0)
    return new_state
*is_successful*() seems i have to use this
k

Kevin Kho

01/24/2022, 6:15 PM
You got this working?
s

Suresh R

01/25/2022, 5:33 PM
Yes
4 Views