Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Last active May 19, 2020 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfarah86/cef26bc4d631e95ffbfe4ddbbfbc7668 to your computer and use it in GitHub Desktop.
Save nfarah86/cef26bc4d631e95ffbfe4ddbbfbc7668 to your computer and use it in GitHub Desktop.
Use Rockset's Python client to execute an API
# code
from rockset import Client, ParamDict
# more code
def get_avg_pm10_results():
rs = Client(api_key=ROCKSET_API_KEY, api_server='https://api.rs2.usw2.rockset.com')
# retrieve Query Lambda
qlambda = rs.QueryLambda.retrieve(
'YOUR LAMBDA',
version=1,
workspace='commons'
)
params = ParamDict()
results = qlambda.execute(parameters=params)
return results.results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment