# Transform Tasks

Verified by Prefect

These tasks have been tested and verified by Prefect.

This module contains a collection of tasks to interact with Transform metrics layer.

# TransformCreateMaterialization

class

prefect.tasks.transform.transform_tasks.TransformCreateMaterialization

(api_key=None, api_key_env_var=None, mql_server_url=None, mql_server_url_env_var=None, materialization_name=None, model_key_id=None, start_time=None, end_time=None, output_table=None, force=False, wait_for_creation=True, **kwargs)[source]

Task to create a materialization against a Transform metrics layer deployment. Please refer to Transform official documentation for more information. This task uses Transform official MQL Client under the hood.

Args:

  • api_key (str, optional): Transform API Key to be used to connect to Transform MQL Server.
  • api_key_env_var (str, optional): The name of the environment variable that contains the API Key to be used to connect to Transform MQL Server.
  • mql_server_url (str, optional): The URL of the Transform MQL Server from which to create the materialization.
  • mql_server_url_env_var (str, optional): The name of the environment variable that contains the URL of the Transform MQL Server from which to create the materialization.
  • materialization_name (str, optional): The name of the Transform materialization to create.
  • model_key_id (int, optional): The unique identifier of the Transform model against which the transformation will be created.
  • start_time (str, optional): The UTC start time of the materialization.
  • end_time (str, optional): The UTC end time of the materialization.
  • output_table (str, optional): The name of the database table, in the form of schema_name.table_name, where the materialization will be created.
  • force (bool, optional): Whether to force the materialization creation or not. Defaults to False.
  • wait_for_creation (bool, optional): Whether to wait for the materialization creation or not. Defaults to True.
  • **kwargs (dict, optional): Additional keyword arguments to pass to the Task constructor.

methods:                                                                                                                                                       

prefect.tasks.transform.transform_tasks.TransformCreateMaterialization.run

(api_key=None, api_key_env_var=None, mql_server_url=None, mql_server_url_env_var=None, materialization_name=None, model_key_id=None, start_time=None, end_time=None, output_table=None, force=False, wait_for_creation=True)[source]

Task run method to create a materialization against a Transform metrics layer deployment. All parameters can be provided either during task initialization or directly in this run method.

Args:

  • api_key (str, optional): Transform API Key to be used to connect to Transform MQL Server.
  • api_key_env_var (str, optional): The name of the environment variable that contains the API Key to be used to connect to Transform MQL Server.
  • mql_server_url (str, optional): The URL of the Transform MQL Server from which to create the materialization.
  • mql_server_url_env_var (str, optional): The name of the environment variable that contains the URL of the Transform MQL Server from which to create the materialization.
  • materialization_name (str, optional): The name of the Transform materialization to create.
  • model_key_id (int, optional): The unique identifier of the Transform model against which the transformation will be created.
  • start_time (str, optional): The UTC start time of the materialization.
  • end_time (str, optional): The ISO end time of the materialization.
  • output_table (str, optional): The name of the database table, in the form of schema_name.table_name, where the materialization will be created.
  • force (bool, optional): Whether to force the materialization creation or not. Defaults to False.
  • wait_for_creation (bool, optional): Whether to wait for the materialization creation or not. Defaults to True.
Raises:
  • ValueError if both api_key and api_key_env_var are missing. - ValueError if both mql_server_url and mql_server_url_env_var are missing. - ValueError if materialization_name is missing. - prefect.engine.signals.FAIL if the connection with the Transform server cannot be established. - prefect.engine.signals.FAIL if the materialization creation process fails.


Returns:
  • An MqlMaterializeResp object if wait_for_creation is True. - An MqlQueryStatusResp object if wait_for_creation is False.



This documentation was auto-generated from commit ffa9a6c
on February 1, 2023 at 18:44 UTC