Functions

Snowaver allows importing python functions into your jinja environment via the Functions page, then using them like Jinja macros in Jobs or Macro Libraries.

Properties

Name

The name of the function.

It must be unique within a project, and matches exactly with the name specified in the definition.

Packages

This property is optional.

You can include any required third-party packages from Snowflake’s Anaconda Channel.

However, you don’t need to specify the following pre-loaded packages:

  • snowflake-snowpark-python

  • jinja2

  • json5

  • requests

  • paramiko

  • ruamel.yaml

  • pyjwt

Warning

Adding third-party packages may increase the time required for testing components using the function. Snoweaver must build and execute a job instance to import these packages at runtime.

Definition

This property stores the Python script for the function definition.

Follow these rules and restrictions when writing the code:

  • The script must begin with the function definition block, specifying the function name and any parameters. For example: def function(var1):

  • The script must contain a single top-level definition block dedicated solely to the function.

  • All subsequent code, including nested functions and import statements, must be enclosed within the function body.

Warning

Defining a function using the same name as a system function will override the reference to the system function. Please refer to System Functions for the list of system functions.

Validator Jinja Template

This property is optional.

Use it to define the Jinja template to validate your functions.