Use Rockset's Python client to execute an API
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
# 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