nirs4all.pipeline.dagml.errors module
Failure types and fail-loud guards for the dag-ml host backend.
DagMlUnsupported is the catchable error every unsupported-or-failed dag-ml shape raises;
DagMlUnavailable is the narrow error a dag-ml-backend PREFLIGHT raises when NEITHER execution
mechanism is installed (no in-process PyO3 extension AND no dag-ml-cli binary).
DagMlMigrationRequired names a semantic boundary that deliberately cannot use automatic legacy
rollback. _cli_child_error extracts the real cause from a dag-ml-cli failure; _raise_run_failure
decides propagate-vs-fallback for a non-zero subprocess run from the adapter’s structured error_kind
(_run_failure_kind()); _reject_multi_model rejects a multi-model pipeline UP FRONT.
- exception nirs4all.pipeline.dagml.errors.DagMlExportRefusal(operation: str, reason: str, *, mitigation: str)[source]
Bases:
RuntimeErrorA completed native run cannot satisfy a requested export capability.
This error deliberately is not a
DagMlUnsupported: export occurs after training, beyondrun()’s compatibility fallback boundary. Re-running the pipeline through the legacy engine is available only through the explicitcompatibility="legacy-refit"export opt-in.
- exception nirs4all.pipeline.dagml.errors.DagMlMigrationRequired[source]
Bases:
RuntimeErrorA legacy semantic needs an explicit migration and may not auto-fallback.
allow_legacy_fallbackis intentionally limited to ordinary capability and availability boundaries. It must not make a native request appear successful by silently changing its execution contract. Callers must either migrate the pipeline or selectengine="legacy"explicitly. This stays outside the fallback catch hierarchy on purpose.
- exception nirs4all.pipeline.dagml.errors.DagMlPipelinePreflightRequired[source]
Bases:
DagMlMigrationRequiredA generator cannot prove whether it selects a stateful pre-CV concat.
- exception nirs4all.pipeline.dagml.errors.DagMlStatefulConcatTransformMigrationRequired[source]
Bases:
DagMlMigrationRequiredLegacy pre-CV stateful
concat_transformsemantics need an explicit migration.
Bases:
RuntimeErrorNEITHER dag-ml execution mechanism is installed, so the dag-ml backend cannot run at all.
Raised by the dag-ml-backend availability probes: the run-level PREFLIGHT (
preflight_dagml_backend()) when BOTH mechanisms are missing (the in-process PyO3 extensiondag_ml._dag_mldoes not import/load AND thedag-ml-clibinary does not exist), and the in-process/subprocess router’s SUBPROCESS branch when in-process is not selected anddag-ml-cliis absent. Since the ADR-17 cutover madedag-mlthe default engine + a hard dependency,run()catches THIS (alongsideDagMlUnsupported/NotImplementedError) and falls back to the legacy engine WITH A WARNING — so a wheel install that is somehow missing the native backend degrades transparently instead of hard-failing.Deliberately NARROW: it is raised only by those explicit availability probes, NEVER by wrapping a run in a blanket
except ImportError/FileNotFoundError(which would swallow a genuine dag-ml bug). A real dag-ml runtime/operator error is NOT this — it propagates untouched.NOT a subclass of
DagMlUnsupported/NotImplementedError: “the backend is not installed” is a distinct condition from “this pipeline shape is unsupported”, andrun()catches it explicitly.
- exception nirs4all.pipeline.dagml.errors.DagMlUnsupported[source]
Bases:
NotImplementedErrorA pipeline shape (or a dag-ml-cli run of one) the dag-ml backend cannot execute.
A subclass of
NotImplementedErrorso the cutover fallback (try dag-ml; except NotImplementedError → legacy) catches it: an unsupported-or-failed dag-ml shape must NEVER escaperun_via_dagmlas a bareRuntimeError/ValueError(which the fallback would not catch and would hard-fail in production). Raised both for shapes rejected UP FRONT (no splitter, multiple model nodes, …) and for a dag-ml-cli run that failed mid-execution because the SHAPE is unsupported — in either case the fallback redirects the pipeline to the legacy engine. A GENUINE operator bug (a model fit failure) is NOT this — it propagates as a real error (see_raise_run_failure()).