Re-evaluate a SQL query written in mode by setting the liquid variables from Python Notebook
We would like to know if it's possible to re-evaluate a SQL query written in mode by setting the liquid variables from Python.
We have to build a dataset using data from two different databases. Our plan is to query database 1 and then use the returned dataset in python to do some data processing. From there, we want to query database 2 using some of the processed data in python and then include the results in the report builder.
Teodor Mihail Costica
There's no way to do this natively using Python in Mode notebooks. That said, you could conceivably achieve this using some API chaining involving two reports:
- Run the first report via the API: POST Report Runs. This will hand back an object representing the report run.
- Parse the CSV outputs of the above object, and process these via Python on your end to obtain the desired input for the second report.
- Run the second report via the API, passing it the above parameters:
POST Report Runs
I hope that helps - thanks!