Practical lab
Our cloud team will be triggering an AWS Lambda and passing the path to the data being delivered from our ingestion tool. They have asked for a Lambda that will pass that information to your workflow, which should be parameterized. This type of request is very common and allows Databricks to be interacted with using a variety of tooling, such as AWS Step Functions and Jenkins, among others.
Solution
In this solution, we will walk you through the Python code needed to complete the tasks. There are two ways to access Databricks via the REST API – using the requests
package, as shown previously, and using the Python package provided by Databricks. In my solution, I am using the Databricks package to keep things simple. I have not come across a case where the package doesn’t meet my needs, but if it’s not good enough, you can always access the REST API directly.
Lambda code
Here, I am importing all my Python libraries. Take note of the databricks_cli...