Setting up a Snowpark Container Service job
In this section, we will create a simple job to connect to a Snowflake table and conduct some feature engineering tasks by generating new columns. Subsequently, we’ll save the resultant data to the same table within the Snowflake environment. Unlike services, jobs are short-lived, providing a one-time execution of tasks.
In the next section, we will set up the container job.
Setting up the job
For the job, instead of the Flask server implementation for services, we’ll utilize a straightforward main.py
file to execute the job action. We will perform the following steps to set up the job.
Job code
The code for this section is in our GitHub repository under the chapter_8
folder. The folder contains the following files, which are required for the job.
The main.py file
The main.py
file is the core Python script for orchestrating the job’s execution. At its heart lies the following run_job()
function, invoked...