Skip to content

Incomplete argument type annotations in set_ontology #269

@menezesandre

Description

@menezesandre

Issue

The arguments are typed as

entities: dict[str, EntityModel],
edges: dict[str, EdgeModel | tuple[EdgeModel, list[EntityEdgeSourceTarget]]] | None

I.e. it states that the dict values are expected to contain instances of EntityModel and EdgeModel. However, the method also supports receiving types (not instances), and that's how it is used in the documentation and examples. This means that using it as documented results in type checker erros.

Expected

The type annotations should be

entities: dict[str, EntityModel | type[EntityModel],
edges: dict[str, EdgeModel | type[EdgeModel] | tuple[EdgeModel | type[EdgeModel], list[EntityEdgeSourceTarget]]] | None,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions