Steve Vandervalk
11/21/2019, 2:25 AMChris White
from prefect import Task
print(Task(name="Chris"))
# <Task: Chris>
Steve Vandervalk
11/21/2019, 2:27 AMSteve Vandervalk
11/21/2019, 2:27 AMChris White
Steve 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,
)
Steve Vandervalk
11/21/2019, 2:31 AM...state = flow.run(executor=LocalExecutor())
Steve Vandervalk
11/21/2019, 2:31 AMSteve Vandervalk
11/21/2019, 2:32 AMChris White
Steve Vandervalk
11/21/2019, 2:33 AMSteve Vandervalk
11/21/2019, 2:33 AMChris White
Steve Vandervalk
11/21/2019, 2:34 AMSteve Vandervalk
11/21/2019, 2:34 AMChris White
flow.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 AMSteve Vandervalk
11/21/2019, 2:35 AMChris White
flow.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
flow_state = flow.run()
flow_state.result[travel_time_segments_geojson].result
Chris White
Steve Vandervalk
11/21/2019, 2:36 AMSteve Vandervalk
11/21/2019, 2:37 AMChris White
Chris White
Marvin
11/21/2019, 2:38 AM