Skip to content

👌 Scheduler.get_jobs: fix as_dict overload#7314

Open
officialasishkumar wants to merge 1 commit intoaiidateam:mainfrom
officialasishkumar:typing/7296-scheduler-get-jobs-overloads
Open

👌 Scheduler.get_jobs: fix as_dict overload#7314
officialasishkumar wants to merge 1 commit intoaiidateam:mainfrom
officialasishkumar:typing/7296-scheduler-get-jobs-overloads

Conversation

@officialasishkumar
Copy link
Copy Markdown

Fixes #7296

The overload returning a dictionary no longer declares as_dict: Literal[True] = True. Instead, as_dict is required as a keyword-only literal while jobs and user remain positional-compatible with the runtime implementation.

Validation:

  • python3 -m compileall -q src/aiida/schedulers/scheduler.py src/aiida/schedulers/plugins/bash.py src/aiida/schedulers/plugins/direct.py
  • ruff check --ignore PLC0415 src/aiida/schedulers/scheduler.py src/aiida/schedulers/plugins/bash.py src/aiida/schedulers/plugins/direct.py
  • mypy --config-file=pyproject.toml --follow-imports=skip --disable-error-code=misc --disable-error-code=untyped-decorator src/aiida/schedulers/scheduler.py src/aiida/schedulers/plugins/bash.py src/aiida/schedulers/plugins/direct.py

Remove the duplicate default from the Literal[True] overload while keeping jobs and user positional-compatible with the runtime implementation.
@officialasishkumar officialasishkumar changed the title 👌 : fix overload 👌 Scheduler.get_jobs: fix as_dict overload Apr 11, 2026
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.

Figure out better overloads for Scheduler.get_jobs method

1 participant