Skip to content

Inconsistency between Pydantic model and Orange #447

Description

@maxenceprog

My issue in Darfix:

I have an output parameter a of class A.

I have an input parameter b of class B(A).

With orange current version i can connect a output to b input.

First i would expect this is not working.

Second there is an inconsistency with Pydantic and my task fail when I run it as pydantic does not accept an input of class A (And this is what i'm expecting).

Proposition of a fix:

src/ewoksorange/gui/orange_utils/_signals.py:

            if is_input:
                signal = signal_class(name=orangename, type=data_type, doc=doc)
            else:
                # To match with Pydantic Output and Input types must match exactly
                # dynamic by default is True in Orange. It means Orange accept a connection if Output type is a base type
                # of input type.
                # We do not want that so we add `dynamic=False`
                signal = signal_class(name=orangename, type=data_type, doc=doc, dynamic=False)


@payno @loichuder @woutdenolf ? What do you think ?

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