Skip to content

Instantly share code, notes, and snippets.

@ahal
Created October 24, 2018 13:35
Show Gist options
  • Save ahal/16d479946e1ed07b421419ebed701f92 to your computer and use it in GitHub Desktop.
Save ahal/16d479946e1ed07b421419ebed701f92 to your computer and use it in GitHub Desktop.
Recipe Definition Example
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