Transform
API Classes
The API Classes will use Transforms internally. So model.to_endpoint() uses the ModelToEndpoint() transform. If you need more control over the Transform you can use the Core Classes directly.
The Workbench Transform class is a base/abstract class that defines API implemented by all the child classes (DataLoaders, DataSourceToFeatureSet, ModelToEndpoint, etc).
Transform: Base Class for all transforms within Workbench Inherited Classes must implement the abstract transform_impl() method
Transform
Bases: ABC
Transform: Abstract Base Class for all transforms within Workbench. Inherited Classes must implement the abstract transform_impl() method
Source code in src/workbench/core/transforms/transform.py
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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |
__init__(input_name, output_name, catalog_db='workbench')
Transform Initialization
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_name
|
str
|
The Name of the Input Artifact |
required |
output_name
|
str
|
The Name of the Output Artifact |
required |
catalog_db
|
str
|
The AWS Data Catalog Database to use (default: "workbench") |
'workbench'
|
Source code in src/workbench/core/transforms/transform.py
add_output_meta(meta)
Add additional metadata that will be associated with the output artifact Args: meta (dict): A dictionary of metadata
convert_to_aws_tags(metadata)
staticmethod
Convert a dictionary to the AWS V3 Tag format (list of Tag objects)
get_aws_tags()
Get the metadata/tags and convert them into AWS Tag Format
Source code in src/workbench/core/transforms/transform.py
input_type()
output_type()
post_transform(**kwargs)
abstractmethod
pre_transform(**kwargs)
set_input_name(input_name)
set_output_name(output_name)
set_output_tags(tags)
Set the tags that will be associated with the output object Args: tags (Union[list, str]): The list of tags or a '::' separated string of tags
Source code in src/workbench/core/transforms/transform.py
transform(**kwargs)
Perform the Transformation from Input to Output with pre_transform() and post_transform() invocations.
The output artifact is created as a side effect and registered under output_name; this method returns None. Retrieve the created artifact via its name (e.g. Model(output_name)), or use the higher-level API (e.g. FeatureSet.to_model()), which returns the artifact object directly.
Source code in src/workbench/core/transforms/transform.py
transform_impl(**kwargs)
abstractmethod
TransformInput
Bases: Enum
Enumerated Types for Workbench Transform Inputs
Source code in src/workbench/core/transforms/transform.py
TransformOutput
Bases: Enum
Enumerated Types for Workbench Transform Outputs