Page MenuHomeSoftware Heritage

Add type annotations to swh.scheduler.interface
Closed, MigratedEdits Locked

Description

This module was written before we started using type annotations, so most methods do not have them; instead they (usually) mention types in their docstrings.

We should make all types (but db and cur, as usually) explicit in the signatures.

swh.scheduler.backend will need to be updated accordingly.

Event Timeline

vlorentz created this task.

Hi! I intended to work on this so I looked through the code in swh.scheduler.backend and swh.scheduler.interface. Both files seem to have type annotations (except at a couple of places?). At a few places, the types are mentioned in docstrings but AFAICS those are only for dict keys/list items. So, I wanted to ask if this task is still valid?

P.S: I realised I could try using TypedDict to move the type out of docstrings which should complete the remaining part to the task.

@lucifer4j There are still many missing annotations. And yes, TypedDict would be nice