j

    John Ramirez

    2 years ago
    On version 0.9.8 and received this error during testing:
    Unexpected error: AttributeError("'S3ResultHandler' object has no attribute '_client'")
    any thoughts?
    j

    josh

    2 years ago
    What are you testing for this to occur? The
    _client
    attribute was updated in this recent PR https://github.com/PrefectHQ/prefect/pull/2136 and I wonder if there’s a chance it’s being referenced before assignment
    j

    John Ramirez

    2 years ago
    Im running an end-to-end test of a workflow but further review of the code I realize that the handler is not referenced in any of the task
    j

    josh

    2 years ago
    🤔 so the issue is happening without initializing the handler at all?
    j

    John Ramirez

    2 years ago
    I do initialize the result handler but I dont place the object in the task definition
    j

    josh

    2 years ago
    Are you initializing it similar to this?
    In [21]: S3ResultHandler(bucket='my-bucket')
    Out[21]: <ResultHandler: S3ResultHandler>
    
    In [22]: r = _
    
    In [23]: r.client
    Out[23]: <botocore.client.S3 at 0x10cc10908>
    
    In [24]: r._client
    Out[24]: <botocore.client.S3 at 0x10cc10908>
    j

    John Ramirez

    2 years ago
    RESULT_HANDLER = S3ResultHandler(
        bucket='workflow-output',
        aws_credentials_secret='AWS_CREDS',
    )
    but then the object is not used anywhere in the workflow code
    j

    josh

    2 years ago
    Does the error happen there when you initialize or when you run your flow?
    j

    John Ramirez

    2 years ago
    run the flow
    j

    josh

    2 years ago
    Weird I’m really not sure how that error would be raised if your flow does not use the S3ResultHandler anywhere
    j

    John Ramirez

    2 years ago
    any suggestions for
    0.9.8
    ? I have already moved back to
    0.9.7
    j

    josh

    2 years ago
    Oh so this works fine on
    0.9.7
    ?
    Do you happen to have a reproduceable example that encounters this?
    j

    John Ramirez

    2 years ago
    Hey josh, I now see what is going on with this result_handler
    I have two workflows: one with retries and the other without. The workflow with retries requires a result_handler at the Flow level. Now on version
    0.9.8
    and
    0.9.7
    I am getting the
    Unexpected error: AttributeError("'S3ResultHandler' object has no attribute '_client'")
    error
    also seems to occur the first time for a mapping task
    j

    Jie Lou

    2 years ago
    Hi @John Ramirez . I met the same error on 0.9.8 and wondering if you have figured it out. Our S3ResultHandler is also set on the flow level.