https://prefect.io logo
b

Belal Aboabdo

02/24/2021, 10:24 PM
Hi I'm trying to checkpoint with
S3Results
but am getting this error when mapping the function.
[2021-02-24 14:11:49-0800] ERROR - prefect.TaskRunner | Task 'plot_map_counts_data[0]': Unexpected error while running task: TypeError("exists() got multiple values for argument 'location'",)
The flow runs successfully without checkpointing, here's an example of the task.
Copy code
@task(
    checkpoint=True,
    target="{flow_name}/{today}/{task_name}_{map_index}.png",
    result=prefect.engine.results.S3Result(bucket=results_s3_bucket),
)
def plot_map_counts_data(df, location, resource):
    #some task
    return image

with Flow("example") as flow:

    plot_map_counts_data.map(
        df,
        locations,
        unmapped("test_resource"),
    )
j

josh

02/24/2021, 10:36 PM
Hi @Belal Aboabdo I believe
location
may end up bring a reserved word here when formatting the target. 🤔 If you change
location
in your task kwargs does it work?
b

Belal Aboabdo

02/24/2021, 10:41 PM
Awesome you're right it worked. Thank you!
j

josh

02/24/2021, 10:41 PM
@Marvin open “Location cannot be used as task kwarg when using Result”
2 Views