Pipeline
Bases: Plan
DataPipeline class to represent a data pipeline in the system, compromising of nodes (input, operators, output) and edges, representing the data flow between nodes.
Source code in blue/data/pipeline.py
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 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 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 | |
create_operator(name, label=None, attributes={}, properties={}, sync=None)
Create an operator entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Operator name (full path, e.g. /server/ |
required | |
label
|
Operator label. |
None
|
|
attributes
|
Operator attributes. |
{}
|
|
properties
|
Operator properties. |
{}
|
|
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 | |
define_input(label=None, value=None, provenance=None, properties={}, sync=None)
Define an input node in the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
Node label. |
None
|
|
value
|
Input value. |
None
|
|
provenance
|
Provenance information. |
None
|
|
properties
|
Node properties. |
{}
|
|
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | |
define_operator(name, label=None, attributes={}, properties={}, sync=None)
Define an operator node in the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Operator name. |
required | |
label
|
Node label. |
None
|
|
attributes
|
Node attributes. |
{}
|
|
properties
|
Node properties. |
{}
|
|
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | |
define_output(label=None, value=None, provenance=None, properties={}, sync=None)
Define an output node in the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
Node label. |
None
|
|
value
|
Output value. |
None
|
|
provenance
|
Provenance information. |
None
|
|
properties
|
Node properties. |
{}
|
|
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | |
get_attribute(key)
Get an attribute for the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Attribute key. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
value |
Attribute value or None if not found. |
Source code in blue/data/pipeline.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
get_attributes()
Get all attributes for the data pipeline.
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary of attribute key-value pairs. |
Source code in blue/data/pipeline.py
188 189 190 191 192 193 194 195 | |
get_node_status(n, provenance=None)
Get the node status for a node in the data pipeline, optionally filtered by provenance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Node object, id, or label. |
required | |
provenance
|
Provenance information. |
None
|
Returns:
| Type | Description |
|---|---|
|
Node status. |
Source code in blue/data/pipeline.py
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 | |
get_node_statuses(n)
Get all node statuses for a node in the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Node object, id, or label. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dictionary of provenance-status pairs. |
Source code in blue/data/pipeline.py
424 425 426 427 428 429 430 431 432 433 434 435 | |
get_node_value(n, provenance=None)
Get the node values for a node in the data pipeline, optionally filtered by provenance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Node object, id, or label. |
required | |
provenance
|
Provenance information. |
None
|
Returns:
| Type | Description |
|---|---|
|
Node value. |
Source code in blue/data/pipeline.py
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | |
get_node_values(n)
Get all node values for a node in the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Node object, id, or label. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
dict |
Dictionary of provenance-value pairs. |
Source code in blue/data/pipeline.py
371 372 373 374 375 376 377 378 379 380 381 382 | |
get_plan_input(pipeline=None)
Get the plan input node for the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline
|
Pipeline entity or ID. |
None
|
Returns:
| Type | Description |
|---|---|
|
Plan input node. |
Source code in blue/data/pipeline.py
261 262 263 264 265 266 267 268 269 270 271 272 | |
get_plan_input_id(pipeline=None)
Get the plan input ID for the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline
|
Pipeline entity or ID. |
None
|
Returns:
| Type | Description |
|---|---|
|
Plan input ID. |
Source code in blue/data/pipeline.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
get_plan_output(pipeline=None)
Get the plan output node for the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline
|
Pipeline entity or ID. |
None
|
Returns:
| Type | Description |
|---|---|
|
Plan output node. |
Source code in blue/data/pipeline.py
317 318 319 320 321 322 323 324 325 326 327 328 | |
get_plan_output_id(pipeline=None)
Get the plan output ID for the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline
|
Pipeline entity or ID. |
None
|
Returns:
| Type | Description |
|---|---|
|
Plan output ID. |
Source code in blue/data/pipeline.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 | |
get_plan_provenance()
Get the plan provenance for the data pipeline.
Returns:
| Name | Type | Description |
|---|---|---|
str |
Plan provenance string. |
Source code in blue/data/pipeline.py
208 209 210 211 212 213 214 215 | |
set_attribute(key, value, sync=None)
Set an attribute for the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Attribute key. |
required |
value
|
Attribute value. |
required | |
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
159 160 161 162 163 164 165 166 167 168 169 170 171 | |
set_node_provenance(n)
Set the node provenance for a node in the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Node object, id, or label. |
required |
Source code in blue/data/pipeline.py
437 438 439 440 441 442 443 444 445 446 447 | |
set_node_status(n, status=None, provenance=None, sync=None)
Set the node status for a node in the data pipeline, optionally for specific provenance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Node object, id, or label. |
required | |
status
|
Status to set. |
None
|
|
provenance
|
Provenance information. |
None
|
|
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | |
set_node_value(n, value=None, provenance=None, sync=None)
Set the node value for a node in the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Node object, id, or label. |
required | |
value
|
Value to set. |
None
|
|
provenance
|
Provenance information. |
None
|
|
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | |
set_plan_input(i, sync=None)
Set the plan input for the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
i
|
Input node object, id, or label. |
required | |
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
set_plan_input_id(input_id, sync=None)
Set the plan input node ID for the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_id
|
Input node ID. |
required | |
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
218 219 220 221 222 223 224 225 226 | |
set_plan_output(o, sync=None)
Set the plan outputfor the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
o
|
Output node object, id, or label. |
required | |
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | |
set_plan_output_id(output_id, sync=None)
Set the plan output node ID for the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_id
|
Output node ID. |
required | |
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
274 275 276 277 278 279 280 281 282 | |
set_plan_provenance(plan_provenance, sync=None)
Set the plan provenance for the data pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan_provenance
|
str
|
Plan provenance string. |
required |
sync
|
Synchronization flag. |
None
|
Source code in blue/data/pipeline.py
198 199 200 201 202 203 204 205 206 | |
Bases: Constant
Status of a node in a data pipeline:
- INITED: node is created, initialized (e.g., input data is not processed yet)
- REFINING: node is being refined (e.g., input data is being processed for refinement)
- REFINED: node is refined (e.g., input data is processed for refinement)
- EXECUTING: node is being executed (e.g., operator is being executed)
- EXECUTED: node is executed (e.g., operator has finished executing)
- PLANNED: node is planned (e.g., operator is planned to be executed)
- FAILED: node has failed (e.g., operator has failed to execute)
Source code in blue/data/pipeline.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
Bases: Constant
Type of a node in a data pipeline:
- INPUT: node is an input node
- OUTPUT: node is an output node
- OPERATOR: node is an operator node
Source code in blue/data/pipeline.py
48 49 50 51 52 53 54 55 56 57 58 | |
Bases: Constant
Type of an entity in a data pipeline:
- OPERATOR: entity is an operator
- DATA_PIPELINE: entity is a data pipeline
Source code in blue/data/pipeline.py
66 67 68 69 70 71 72 73 74 75 | |