-
Notifications
You must be signed in to change notification settings - Fork 154
Description
What happened?
There are multiple instances in the codebase where wait_for_job_status implementations use a mutable set literal as a default argument:
def wait_for_job_status(
self,
name: str,
status: set[str] = {constants.TRAINJOB_COMPLETE}, # ← mutable default
...
What did you expect to happen?
The parameter should default to None, with the real value assigned inside the function body:
def wait_for_job_status(
self,
name: str,
status: set[str] | None = None,
...
) -> types.TrainJob:
if status is None:
status = {constants.TRAINJOB_COMPLETE}
This is the canonical Python pattern for mutable defaults and ensures each call gets a fresh, independent set.
Environment
nil
Impacted by this bug?
Give it a 👍 We prioritize the issues with most 👍
Reactions are currently unavailable