- class flytekitplugins.snowflake.SnowflakeTask(*args, **kwargs)#
This is the simplest form of a Snowflake Task, that can be used even for tasks that do not produce any output.
To be used to query Snowflake databases.
name – Name of this task, should be unique in the project
query_template – The actual query to run. We use Flyte’s Golang templating format for Query templating. Refer to the templating documentation
task_config – SnowflakeConfig object
inputs – Name and type of inputs specified as an ordered dictionary
output_schema_type – If some data is produced by this query, then you can specify the output schema type
kwargs – All other args required by Parent type - SQLTask
- compile(ctx, *args, **kwargs)#
Generates a node that encapsulates this task in a workflow definition.
Used when constructing the node that encapsulates this task as part of a broader workflow definition.
- Return type
- dispatch_execute(ctx, input_literal_map)#
This method translates Flyte’s Type system based input values and invokes the actual call to the executor This method is also invoked during runtime.
VoidPromiseis returned in the case when the task itself declares no outputs.
Literal Mapis returned when the task returns either one more outputs in the declaration. Individual outputs may be none
DynamicJobSpecis returned when a dynamic workflow is executed
Returns the task config as a serializable dictionary. This task config consists of metadata about the custom defined for this task.
Returns the container definition (if any) that is used to run the task on hosted Flyte.
Return additional plugin-specific custom data (if any) as a serializable dictionary.
Returns the names and python types as a dictionary for the inputs of this task.
Returns the kubernetes pod definition (if any) that is used to run the task on hosted Flyte.
Returns the Sql definition (if any) that is used to run the task on hosted Flyte.
- get_type_for_input_var(k, v)#
Returns the python type for an input variable by name.
- get_type_for_output_var(k, v)#
Returns the python type for the specified output variable by name.
- classmethod interpolate_query(query_template, **kwargs)#
This function will fill in the query template with the provided kwargs and return the interpolated query. Please note that when SQL tasks run in Flyte, this step is done by the task executor.
- Return type
- local_execute(ctx, **kwargs)#
This function is used only in the local execution path and is responsible for calling dispatch execute. Use this function when calling a task with native values (or Promises containing Flyte literals derived from Python native values).
- post_execute(user_params, rval)#
Post execute is called after the execution has completed, with the user_params and can be used to clean-up, or alter the outputs to match the intended tasks outputs. If not overridden, then this function is a No-op
This is the method that will be invoked directly before executing the task method and before all the inputs are converted. One particular case where this is useful is if the context is to be modified for the user process to get some user space parameters. This also ensures that things like SparkSession are already correctly setup before the type transformers are called
This should return either the same context of the mutated context
If true, this task will not output deck html file
Any environment variables that supplied during the execution of the task.
Returns this task’s python interface.
Returns the user-specified task config which is used for plugin-specific handling of the task.