microsoft / microsoft/durabletask-python

Add task hub and instance ID prefix orchestration query filters

Open
#222 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
40
Forks
33
Avg merge
2d 2h
Merged PRs (30d)
6

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with OrchestrationQuery and build_query_instances_req(), then trace their sync and async client callers. Compare the existing query fields with the .NET OrchestrationQuery references and add tests for each filter independently and together; done means both fields serialize into InstanceQuery while omitted fields preserve current requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.