-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Labels
area/streamingStreaming actions, parallel streamsStreaming actions, parallel streamsarea/typingMypy, type hints, pydanticMypy, type hints, pydanticgood first issueGood for newcomersGood for newcomerskind/bugSomething is brokenSomething is brokenpriority/highAffects many users, needs action within weeksAffects many users, needs action within weeks
Description
Current behavior
When it's a union type it complains:
union = MyModel1 | MyModel2
@streaming_action.pydantic(
reads=[...],
writes=[...],
state_input_type=...,
state_output_type=...
stream_type=union, # type hint says this is invalid
)
because it is typed with :
stream_type: Union[Type["BaseModel"], Type[dict]],
Library & System Information
Latest burr
Expected behavior
It should be fine.
Additional context
The fix I think is to expand that stream type to handle a union of BaseModel types.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/streamingStreaming actions, parallel streamsStreaming actions, parallel streamsarea/typingMypy, type hints, pydanticMypy, type hints, pydanticgood first issueGood for newcomersGood for newcomerskind/bugSomething is brokenSomething is brokenpriority/highAffects many users, needs action within weeksAffects many users, needs action within weeks