Skip to content

Declare taskSpec in JobGeneratorThread.runImpl as JediTaskSpec - #884

Merged
tmaeno merged 1 commit into
PanDAWMS:masterfrom
tmaeno:taskspec-runimpl-type
Nov 23, 2026
Merged

tmaeno merged 1 commit into
PanDAWMS:masterfrom
tmaeno:taskspec-runimpl-type

Conversation

@tmaeno

@tmaeno tmaeno commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

taskSpec in runImpl comes from an element of the untyped ListWithLock, so static readers see it as Any and none of the method calls on it resolve. This declares it as JediTaskSpec.

With the type known, mypy checks those calls and finds two mismatches:

  • JobBroker.getBaseLockID asked for str, but only hands vo and sourceLabel on to FactoryBase.requireImpl, which takes str | None. Its parameters are widened to match.
  • resetUnusedFiles_JEDI and setUseJumboFlag_JEDI take an int, and jediTaskID is a column, declared optional. Those three calls are ignored the same way as the lockTask_JEDI calls in the same function.

No change at runtime.

runImpl unpacks taskSpec from an element of the input list, and
ListWithLock is untyped by design, so no static reader knows the class
of taskSpec there: mypy treats it as Any, and none of the method calls
on it in runImpl resolve. Declare it.

With the type known, mypy checks those calls and finds two mismatches:
- JobBroker.getBaseLockID asked for str, but only hands vo and
  sourceLabel on to FactoryBase.requireImpl, which takes str | None.
  Widen its parameters to match.
- resetUnusedFiles_JEDI and setUseJumboFlag_JEDI take an int, and
  jediTaskID is a column, declared optional. Ignore those three calls
  the same way as the lockTask_JEDI calls in the same function.

No change at runtime.
@tmaeno
tmaeno merged commit 78463a7 into PanDAWMS:master Nov 23, 2026
1 check passed
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