Skip to content

Conversation

@Om7035
Copy link
Contributor

@Om7035 Om7035 commented Nov 29, 2025

Description:
Adds detailed documentation for the Query class to the SDK developer training guide and includes a code example for creating custom queries.

  • Add docs/sdk_developers/training/query.md explaining Query architecture, execution flow, payment handling, and retry logic.
  • Add examples/query/custom_query_example.py demonstrating how to subclass Query to create a custom implementation.

Related issue(s):

Fixes #910

Notes for reviewer:
This PR addresses the need for better internal documentation regarding the Query class. The new guide explains how Query inherits from _Executable and handles common tasks like node selection and retries. The example script custom_query_example.py shows a practical implementation of AccountBalanceQuery as a custom query to illustrate the necessary abstract method implementations.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@github-actions
Copy link

[commit-verification-bot]
Hi, this is VerificationBot.
Your pull request cannot be merged as it has unverified commits.
View your commit verification status: Commits Tab.

To achieve verified status, please read:

Remember, you require a GPG key and each commit must be signed with:
git commit -S -s -m "Your message here"

Thank you for contributing!

From the Hiero Python SDK Team

@github-actions
Copy link

Hi, this is WorkflowBot.
Your pull request cannot be merged as it is not passing all our workflow checks.
Please click on each check to review the logs and resolve issues so all checks pass.
To help you:

@Om7035 Om7035 force-pushed the docs/query-guide branch 6 times, most recently from e848dec to 1becd9f Compare November 29, 2025 19:07
@Om7035
Copy link
Contributor Author

Om7035 commented Nov 29, 2025

@exploreriii can you check!!!

Adds detailed documentation for the Query class and a custom query example.

Fixes hiero-ledger#910

Signed-off-by: Om7035 <[email protected]>
balance_response = query.execute(client)

# The response is the raw protobuf object because we didn't override _map_response
# to convert it to a nice SDK object (like the official AccountBalanceQuery does).
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @Om7035
We have a problem

We require all our examples to be runnable and 'work'

So, in this case, your a new sample class does not fully run - so the workflow fails

Either make sure that it runs, see

examples/query/account_balance_query.py
or
examples/query/account_balance_query_2.py
and
src/hiero_sdk_python/query/account_balance_query.py

or, add it to your query.md making it clear its a simplified example

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Hello, this is the Office Hour Bot.

This is a reminder that the Hiero Python SDK Office Hours are scheduled in approximately 4 hours (14:00 UTC).

This session provides an opportunity to ask questions regarding this Pull Request or receive assistance from a maintainer.

Details:

Disclaimer: This is an automated reminder. Please verify the schedule here to be notified of any changes.

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.

Create docs/sdk_developers/training/query.md

2 participants