Created
October 24, 2018 13:35
-
-
Save ahal/16d479946e1ed07b421419ebed701f92 to your computer and use it in GitHub Desktop.
Recipe Definition Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEFINITION = { | |
"name": "example_recipe", | |
"arguments": [ ... ], | |
"queries": [ | |
{ | |
"name": "query_name_1", | |
"callback": process_query_1, | |
}, | |
{ | |
"name": "query_name_2", | |
"query_args": [ ... ], | |
}, | |
], | |
"callback": process_overall_result, | |
} | |
def process_query_1(data, context): | |
# Do post processing on the first query, modifying the data and/or context. | |
# The context will be passed into the next query. | |
return data. context | |
def process_overall_result(*data_sets): | |
# There is one data set per query that was called. | |
return data_to_be_formatted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment