Streaming Event type, type hint, should support union type
维护者通常 4 天内回复
@mvanhorn 已经在做这个了。
开始于 2026年4月8日。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 66/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- python
调研方向
定位 streaming_action.pydantic 入口点及其 stream_type 注解,然后检查该注解是如何被验证的,或如何暴露给类型检查器。使用 issue 中的 union 示例确认现有行为;如果周围的测试提供了合适的位置,则添加或更新针对性覆盖。完成的标准是:接受 BaseModel 变体的 union 类型,且不会将类型提示报告为无效。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 2.6k
- 派生
- 208
- 平均合并
- 6 天 7 小时
- 30 天内合并 PR
- 26
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/burr 的其他 Issue
-
Notebook UI launcher should use the current Python interpreter可能已有人在做 @sivakumar-mahalingam 于 10 天前认领。 未关闭status/needs-triage
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 4 天内回复
-
astep() passes unprocessed inputs to pre_run_step hooks可能已有人在做 @sivakumar-mahalingam 于 10 天前认领。 未关闭status/needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 4 天内回复
-
`burr` fails to start when the Python path has a space in it可能已有人在做 @enekoreto 于 13 天前认领。 未关闭status/needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 4 天内回复
-
area/storage area/ui help wanted kind/documentation priority/low
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 4 天内回复
-
Add documentation on how to run the Burr UI server可能重新可做 @iamSerafinnn 于 142 天前认领,目前没有进行中的 PR。 未关闭area/ui good first issue kind/documentation priority/low
难度 2/5 半天 新手友好度 68/100
维护者通常 4 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
521xueweihan/HelloGitHub#4150 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
aws-samples/sample-per-model-bedrock#595 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
bug connectors
难度 1/5 1 小时以内 新手友好度 67/100
pyinfra-dev/pyinfra#2036 ·
维护者通常 9 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复