fix: remove dead imports shadowed by local redefinitions in build_stream - #5026
Open
harshadkhetpal wants to merge 1 commit into
Open
fix: remove dead imports shadowed by local redefinitions in build_stream#5026harshadkhetpal wants to merge 1 commit into
harshadkhetpal wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Harshad Khetpal <harshadkhetpal@users.noreply.github.com>
harshadkhetpal
force-pushed
the
fix/remove-shadowed-dead-imports
branch
from
August 25, 2026 14:20
280dafd to
e5548f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:api/{build_image,local_repo,validate}/dependencies.py— each imports_get_containerand 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_containerfrom the three import lists.container.py— imports_DEFAULT_POLICY_PATH, _DEFAULT_SCHEMA_PATHfromcore.catalog.adapter_policy, then redefines both from the local resources directory ~40 lines later. The redefinitions win; removed the dead import.orchestrator/local_repo/use_cases/create_local_repo.py— two method-localfrom core.jobs.value_objects import StageStatere-imports that shadow the module-level import of the same name; removed.Testing
python -m py_compilepasses on all five files;ruff check --select F811onbuild_stream/(excluding tests) goes clean. No runtime behavior change — every removed name was shadowed before use.🤖 Generated with Claude Code