Skip to content

Preserve modular pipeline component load errors - #15502

Open
VedanthB wants to merge 1 commit into
huggingface:mainfrom
VedanthB:modular-component-load-errors
Open

VedanthB wants to merge 1 commit into
huggingface:mainfrom
VedanthB:modular-component-load-errors

Conversation

@VedanthB

@VedanthB VedanthB commented Dec 5, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes #15227. This follows the maintainer discussion on deferring the error to the failing block.

ModularPipeline keeps successfully loaded components when another component fails. If a block then hits a None access while one of its declared components has an unresolved load error, the original block exception stays intact and includes the load error as a possibly related note. Workflows that skip the failed component still run. Successfully loading or replacing the component clears the saved error.

The regression tests use a local scheduler with a missing config. They cover standalone and sequential blocks, skipping the failed component, recovering through a reload or replacement, and preserving an unrelated input error.

python -m pytest -q tests/modular_pipelines/test_modular_pipeline_loading.py tests/modular_pipelines/test_conditional_pipeline_blocks.py
60 passed

Self-review: checked the direct, sequential, conditional, and loop error paths. Kept the block exception and traceback instead of chaining the load error because a missing component may not be the source of the None value. No new dependencies or public API changes.

AI assistance: OpenAI Codex assisted with the implementation, tests, and self-review.

Before submitting

  • AI assistance disclosed, contribution guide followed, and final self-review included.
  • Maintainer discussion linked.
  • Regression tests added.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How should ModularPipeline handle a component that failed to load?

1 participant