Steve Vandervalk
11/21/2019, 2:25 AMChris White
11/21/2019, 2:26 AMfrom prefect import Task
print(Task(name="Chris"))
# <Task: Chris>
Steve Vandervalk
11/21/2019, 2:27 AMChris White
11/21/2019, 2:28 AMSteve Vandervalk
11/21/2019, 2:31 AMwith Flow("Mapbox API Travel Time Retrieval and Processing") as flow:
download_geojson_blob_task = DownloadBlobFromAzure()
azure_blob_name = "travel_time_segments.geojson"
azure_container = "ottawa-mapbox-travel-time-inputs"
travel_time_segments_geojson = download_geojson_blob_task(
blob_name=azure_blob_name,
azure_credentials_secret="AZ_CREDS",
container=azure_container,
)
...state = flow.run(executor=LocalExecutor())
Chris White
11/21/2019, 2:32 AMSteve Vandervalk
11/21/2019, 2:33 AMChris White
11/21/2019, 2:33 AMSteve Vandervalk
11/21/2019, 2:34 AMChris White
11/21/2019, 2:34 AMflow.run
- so inputting a breakpoint within the build step of a Flow will not contain any results / data since nothing has run yetSteve Vandervalk
11/21/2019, 2:35 AMChris White
11/21/2019, 2:35 AMflow.run
a Prefect State is returned whose result
attribute is a dictionary mapping Tasks -> task states, which have a result
attribute themselves containing the return value from that task runSteve Vandervalk
11/21/2019, 2:35 AMChris White
11/21/2019, 2:36 AMflow_state = flow.run()
flow_state.result[travel_time_segments_geojson].result
Steve Vandervalk
11/21/2019, 2:36 AMChris White
11/21/2019, 2:37 AMMarvin
11/21/2019, 2:38 AM