Peyton Runyan
02/25/2021, 5:47 PMValueError: Could not infer an active Flow context.
Details in thread
with Flow("Batch update airtable flow") as f:
proj, stry = get_selected_bases()
cmdf = get_communities_2017()
scrubbed_proj, scrubbed_stry = scrub_dataframes(proj, stry, cmdf)
debug_task(scrubbed_proj, scrubbed_stry)
Peyton Runyan
02/25/2021, 5:48 PM[2021-02-25 12:44:28-0500] INFO - prefect.FlowRunner | Beginning Flow run for 'Batch update airtable flow'
[2021-02-25 12:44:28-0500] INFO - prefect.TaskRunner | Task 'Get selected bases': Starting task run...
[2021-02-25 12:44:35-0500] INFO - prefect.TaskRunner | Task 'Get selected bases': Finished task run for task with final state: 'Success'
[2021-02-25 12:44:35-0500] INFO - prefect.TaskRunner | Task 'GetItem': Starting task run...
[2021-02-25 12:44:35-0500] INFO - prefect.TaskRunner | Task 'GetItem': Finished task run for task with final state: 'Success'
[2021-02-25 12:44:35-0500] INFO - prefect.TaskRunner | Task 'Get Communities_2017 from DB': Starting task run...
[2021-02-25 12:44:36-0500] INFO - prefect.TaskRunner | Task 'Get Communities_2017 from DB': Finished task run for task with final state: 'Success'
[2021-02-25 12:44:36-0500] INFO - prefect.TaskRunner | Task 'GetItem': Starting task run...
[2021-02-25 12:44:36-0500] INFO - prefect.TaskRunner | Task 'GetItem': Finished task run for task with final state: 'Success'
[2021-02-25 12:44:36-0500] INFO - prefect.TaskRunner | Task 'Scrub dataframes': Starting task run...
[2021-02-25 12:44:36-0500] ERROR - prefect.TaskRunner | Unexpected error: ValueError('Could not infer an active Flow context.')
Peyton Runyan
02/25/2021, 5:49 PMscrubbed_proj, scrubbed_stry = scrub_dataframes(proj, stry, cmdf)
This is scrub_dataframes
@task(name="Scrub dataframes", nout=2)
def scrub_dataframes(proj, stry, cmdf):
scrubbed_proj = scrub_proj(cmdf, proj)
scrubbed_stry = scrub_stry(stry)
return scrubbed_proj, scrubbed_stry
Peyton Runyan
02/25/2021, 5:50 PMPeyton Runyan
02/25/2021, 6:00 PMPeyton Runyan
02/25/2021, 6:08 PMValueError('Could not infer an active Flow context.')
if the functions themselves are broken