Skip to content

feat(client): add task hub name filter to orchestration queries - #295

Open
Hardik K (hardikkaurani) wants to merge 1 commit into
microsoft:mainfrom
hardikkaurani:feature/task-hub-query-filter
Open

Hardik K (hardikkaurani) wants to merge 1 commit into
microsoft:mainfrom
hardikkaurani:feature/task-hub-query-filter

Conversation

@hardikkaurani

Copy link
Copy Markdown

Resolves #222.

Summary

The protobuf InstanceQuery message defines field 4 taskHubNames (repeated google.protobuf.StringValue). While instance_id_prefix was previously added to OrchestrationQuery, filtering orchestration queries by task hub names was still missing.

This change adds task_hub_names to OrchestrationQuery and serializes it in build_query_instances_req() to align with client query capabilities across SDKs.

Changes

  1. durabletask/client.py:

    • Added task_hub_names: list[str] | None = None to OrchestrationQuery.
    • Backward compatibility and existing parameter order are fully preserved.
  2. durabletask/internal/client_helpers.py:

    • In build_query_instances_req(), serialized task_hub_names into InstanceQuery.taskHubNames as wrappers_pb2.StringValue.
  3. tests/durabletask/test_batch_actions.py:

    • Added test_orchestration_query_serializes_task_hub_names to verify taskHubNames protobuf serialization.
    • Added test_orchestration_query_serializes_task_hub_names_and_instance_id_prefix covering combined filter queries.
    • Updated test_orchestration_query_preserves_positional_argument_order to verify default behavior when fields are omitted.
  4. CHANGELOG.md:

    • Documented OrchestrationQuery.task_hub_names under Unreleased.

Validation

  • Unit tests for query filter serialization pass cleanly.
  • Strict Pyright type check passes with 0 errors.
  • Default query behavior remains fully backward-compatible.

Closes microsoft#222.

- Adds 	ask_hub_names: list[str] | None = None to OrchestrationQuery.
- Serializes 	ask_hub_names into InstanceQuery.taskHubNames as 
epeated google.protobuf.StringValue in �uild_query_instances_req().
- Updates unit tests covering 	ask_hub_names serialization independently, combined with instance_id_prefix, and verifying positional argument order preservation.
- Documents the addition in CHANGELOG.md under Unreleased.
Copilot AI balanced review requested due to automatic review settings October 16, 2026 21:33
@hardikkaurani

Copy link
Copy Markdown
Author

Hello Bernd Verst (@berndverst),

I have submitted this pull request to resolve issue #222 by adding task_hub_names to OrchestrationQuery and serializing it through build_query_instances_req via wrappers_pb2.StringValue.

Positional argument order and backward compatibility for existing query instances are maintained, unit test coverage has been added in tests/durabletask/test_batch_actions.py, and strict Pyright type checking passes with zero errors.

Please review when convenient and let me know if any adjustments are desired.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The additive change preserves compatibility, matches the protobuf contract, and includes focused regression coverage.

No open issues 🎉

What changed in this PR

Adds task hub filtering to orchestration queries, completing the remaining filter support requested in #222 while preserving existing constructor argument order.

Changes:

  • Adds task_hub_names and serializes it into the existing protobuf field.
  • Tests task hub filtering alone and alongside instance ID prefixes.
  • Documents the new capability under Unreleased.
File Description
tests/​durabletask/​test_batch_actions.py Adds serialization and compatibility assertions.
durabletask/​internal/​client_helpers.py Serializes task hub names into query requests.
durabletask/​client.py Adds the optional task hub filter.
CHANGELOG.md Documents the new query capability.

Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add task hub and instance ID prefix orchestration query filters

2 participants