Builder¶
Converts a ChoregraphSpec into a Kedro Pipeline object. Sits between the parser
(which produces the spec) and the Kedro runner. Resolves input/output port connections,
applies XSD-based type conversion for parameters, and generates Kedro node definitions.
builder
¶
Pipeline builder -- converts a ChoregraphSpec into Kedro Pipeline objects.
Sits between the parser (which produces ChoregraphSpec) and the Kedro runner. Resolves input/output port connections, applies XSD-based type conversion for parameters, and produces Kedro Pipeline objects with correctly wired nodes.
parse_port_value
¶
Convert a raw string value to the appropriate Python type.
| PARAMETER | DESCRIPTION |
|---|---|
raw_value
|
The string value from the XML port.
TYPE:
|
port_type
|
The resolved type (FLOAT, INTEGER, BOOLEAN, LIST, etc.).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
|
The converted Python value. |
Source code in src/choregraph/builder.py
parse_ports_to_kwargs
¶
Convert port values from strings to appropriate Python types.
Uses the function catalogue extracted from the XSD to determine the
expected type for each port (FLOAT, INTEGER, BOOLEAN, LIST, STRING).
The XML type attribute on each port takes priority over the catalogue.
| PARAMETER | DESCRIPTION |
|---|---|
input_ports
|
List of input port specifications to convert.
TYPE:
|
function_name
|
Transform function name for catalogue lookup.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Dict[str, Any]
|
Dict mapping port names to their converted Python values. |
Source code in src/choregraph/builder.py
build_pipeline_from_spec
¶
Build a Kedro Pipeline from a ChoregraphSpec.
| PARAMETER | DESCRIPTION |
|---|---|
spec
|
The ChoregraphSpec defining the pipeline
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Pipeline
|
Tuple of (Pipeline, label_mapping) where label_mapping maps sanitized node names |
Dict[str, str]
|
to their human-readable labels for display in Kedro Viz |
Source code in src/choregraph/builder.py
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 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | |