Register a step type instance in the global registry. Raises ``ValueError`` for falsy keys and ``KeyError`` for duplicates.
(step: StepBase)
| 23 | |
| 24 | |
| 25 | def _register_step(step: StepBase) -> None: |
| 26 | """Register a step type instance in the global registry. |
| 27 | |
| 28 | Raises ``ValueError`` for falsy keys and ``KeyError`` for duplicates. |
| 29 | """ |
| 30 | key = step.type_key |
| 31 | if not key: |
| 32 | raise ValueError("Cannot register step type with an empty type_key.") |
| 33 | if key in STEP_REGISTRY: |
| 34 | raise KeyError(f"Step type with key {key!r} is already registered.") |
| 35 | STEP_REGISTRY[key] = step |
| 36 | |
| 37 | |
| 38 | def get_step_type(type_key: str) -> StepBase | None: |
no outgoing calls