prefect_transform.tasks
Collection of tasks to interact with Transform metrics catalog
create_materialization
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.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
credentials |
TransformCredentials
|
|
required |
materialization_name |
str
|
The name of the Transform materialization to create. |
required |
model_key_id |
Optional[int]
|
The unique identifier of the Transform model against which the transformation will be created. |
None
|
start_time |
Optional[str]
|
The UTC start time of the materialization. |
None
|
end_time |
Optional[str]
|
The UTC end time of the materialization. |
None
|
output_table |
Optional[str]
|
The name of the database table, in the form of
|
None
|
force |
bool
|
Whether to force the materialization creation
or not. Defaults to |
False
|
wait_for_creation |
Optional[bool]
|
Whether to wait for the materialization
creation or not. Defaults to |
True
|
Returns:
Type | Description |
---|---|
Union[MqlMaterializeResp, MqlQueryStatusResp]
|
An |
Union[MqlMaterializeResp, MqlQueryStatusResp]
|
An |
from prefect import flow
from prefect_transform.tasks import (
create_materialization
)
@flow
def trigger_materialization_creation():
create_materialization(
api_key="<your Transform API key>",
mql_server_url="<your MQL Serverl URL>",
materialization_name="<name of the materialization>",
wait_for_creation=False
)
trigger_materialization_creation()
Source code in prefect_transform/tasks.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|