style(miles): hoist function-local imports to module top#25
Open
TianyeGGBond wants to merge 1 commit into
Open
style(miles): hoist function-local imports to module top#25TianyeGGBond wants to merge 1 commit into
TianyeGGBond wants to merge 1 commit into
Conversation
asyncio (miles_model_update_service) and os (miles_coordinator) were imported inside method bodies. Both are already cheap stdlib imports with no circular-import concern, so move them to the module top to match the surrounding import style. - miles_model_update_service.py: drop the redundant `import asyncio` inside sync_selected_workers (the module already imports asyncio at the top). - miles_coordinator.py: add `import os` at the top and replace the two `import os as _os` / `_os.environ` sites with `os.environ`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Context
Two cheap stdlib imports were done inside method bodies instead of at the
module top, which is out of step with the rest of these files (everything
else imports at the top). Neither has a circular-import reason to be local.
Change
pipeline/miles_model_update_service.py: drop the redundantimport asyncioinsidesync_selected_workers— the module alreadyimports
asyncioat the top.pipeline/miles_coordinator.py: addimport osat the top and replacethe two
import os as _os/_os.environ.get(...)sites(
_expand_workers,_make_actor_scheduling_strategy) withos.environ.No behavior change; +3 / -7 lines.