Skip to content

fix: remove dead imports shadowed by local redefinitions in build_stream - #5026

Open
harshadkhetpal wants to merge 1 commit into
dell:mainfrom
harshadkhetpal:fix/remove-shadowed-dead-imports
Open

fix: remove dead imports shadowed by local redefinitions in build_stream#5026
harshadkhetpal wants to merge 1 commit into
dell:mainfrom
harshadkhetpal:fix/remove-shadowed-dead-imports

Conversation

@harshadkhetpal

Copy link
Copy Markdown

Summary

Several names in build_stream/ are imported and then immediately shadowed by local redefinitions (ruff F811), leaving dead imports that contradict the code's own intent:

  1. api/{build_image,local_repo,validate}/dependencies.py — each imports _get_container and then redefines it locally with a comment saying the local version exists to avoid circular imports. The import in the list re-creates exactly the coupling the comment says it avoids, and the local def wins anyway. Removed _get_container from the three import lists.
  2. container.py — imports _DEFAULT_POLICY_PATH, _DEFAULT_SCHEMA_PATH from core.catalog.adapter_policy, then redefines both from the local resources directory ~40 lines later. The redefinitions win; removed the dead import.
  3. orchestrator/local_repo/use_cases/create_local_repo.py — two method-local from core.jobs.value_objects import StageState re-imports that shadow the module-level import of the same name; removed.

Testing

python -m py_compile passes on all five files; ruff check --select F811 on build_stream/ (excluding tests) goes clean. No runtime behavior change — every removed name was shadowed before use.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Harshad Khetpal <harshadkhetpal@users.noreply.github.com>
@harshadkhetpal
harshadkhetpal force-pushed the fix/remove-shadowed-dead-imports branch from 280dafd to e5548f0 Compare August 25, 2026 14:20
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.

1 participant