microsoft / microsoft/durabletask-python

Add task hub and instance ID prefix orchestration query filters

未关闭
#222 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
40
派生
33
平均合并
2 天 2 小时
30 天内合并 PR
6

描述

Summary

The protobuf InstanceQuery supports taskHubNames and instanceIdPrefix, and the .NET Durable Task client exposes both filters. Python's OrchestrationQuery and request builder currently omit them.

Current behavior

Python orchestration queries support creation-time bounds, runtime status, result limits, and payload inclusion. There is no way to:

  • restrict results to one or more task hubs;
  • restrict results to instance IDs beginning with a prefix.

The generated protobuf already contains both fields, so no protocol update is required.

Expected parity

Extend OrchestrationQuery with Python-style equivalents of:

  • task_hub_names: list[str] | None
  • instance_id_prefix: str | None

Serialize these through build_query_instances_req() to InstanceQuery.taskHubNames and InstanceQuery.instanceIdPrefix for both sync and async clients.

.NET references:

Acceptance criteria

  • Callers can filter orchestration queries by task hub names.
  • Callers can filter orchestration queries by instance ID prefix.
  • Both fields are serialized into the existing protobuf request.
  • Existing queries remain backward compatible when the fields are omitted.
  • Unit tests cover each filter independently and together.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 OrchestrationQuery 和 build_query_instances_req() 开始,然后追踪它们的同步和异步客户端调用方。将现有的查询字段与 .NET OrchestrationQuery 参考进行比较,并为每个过滤器分别使用以及同时使用时添加测试;当两个字段都序列化到 InstanceQuery 中,且省略的字段保持当前 requests 不变时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
api
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
描述清楚
新手友好度
76/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。