mvanhorn opened a new pull request, #732: URL: https://github.com/apache/burr/pull/732
Python 3.10+ union syntax (`MyModel1 | MyModel2`) creates a `types.UnionType`, which the `stream_type` parameter rejected because it only accepted `Type[BaseModel]` or `Type[dict]`. Added `types.UnionType` to the accepted types in three places: - `burr/integrations/pydantic.py`: `PartialType` alias (line 272) - `burr/integrations/pydantic.py`: `_validate_and_extract_signature_types_streaming` parameter (line 293) - `burr/core/action.py`: `streaming_action.pydantic` parameter (line 1514) Before: ```python stream_type=MyModel1 | MyModel2 # TypeError ``` After: ```python stream_type=MyModel1 | MyModel2 # works ``` Both files already import `types`, so no new imports needed. `types.UnionType` is available in Python 3.10+; on 3.9, the `|` syntax isn't available anyway so the added type is inert. Fixes #607 This contribution was developed with AI assistance (Claude Code). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
