- class flytekitplugins.great_expectations.GreatExpectationsTask(*args, **kwargs)#
This task can be used to validate your data. You can use this when you want to validate your data within the task or workflow. If you want to validate your data as and when the type is given, use the GreatExpectationsType.
name – name of the task
datasource_name – tell where your data lives and how to get it
expectation_suite_name – suite which consists of the data expectations
data_connector_name – connector to identify data batches
inputs – inputs to pass to the execute() method
data_asset_name – name of the data asset (to be used for RuntimeBatchRequest)
local_file_path – dataset file path useful for FlyteFile and FlyteSchema
checkpoint_params – optional SimpleCheckpoint parameters
task_config – batchrequest config
context_root_dir – directory in which GreatExpectations’ configuration resides
TODO: Connect Data Docs to Flyte Console.
Please see class level documentation.
- 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 command which should be used in the container definition for the serialized version of this task registered on a hosted Flyte platform.
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.
settings (flytekit.configuration.SerializationSettings) –
- Return type
Return additional plugin-specific custom data (if any) as a serializable dictionary.
Returns the default pyflyte-execute command used to run this on hosted Flyte platforms.
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.
- 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
Resets the command which should be used in the container definition of this task to the default arguments. This is useful when the command line is overridden at serialization time.
By default, the task will run on the Flyte platform using the pyflyte-execute command. However, it can be useful to update the command with which the task is serialized for specific cases like running map tasks (“pyflyte-map-execute”) or for fast-executed tasks.
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.