Skip to content

chore: Added missing timeout support for some execute() implementations#1736

Open
manishdait wants to merge 4 commits intohiero-ledger:mainfrom
manishdait:chore/missing-timeout-param
Open

chore: Added missing timeout support for some execute() implementations#1736
manishdait wants to merge 4 commits intohiero-ledger:mainfrom
manishdait:chore/missing-timeout-param

Conversation

@manishdait
Copy link
Contributor

Description:
Support for passing a timeout to execute(client, timeout) was introduced earlier PR #1499, but some query sub-classes that override execute() did not forward the parameter when calling _execute().

This PR updates the affected query classes to correctly propagate the timeout argument to ensure execute(client, timeout) behaves consistently across queries.

Related issue(s):

Closes #1735

Notes for reviewer:

Checklist

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

@codecov
Copy link

codecov bot commented Feb 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1736   +/-   ##
=======================================
  Coverage   93.25%   93.25%           
=======================================
  Files         141      141           
  Lines        9061     9061           
=======================================
  Hits         8450     8450           
  Misses        611      611           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@manishdait manishdait added the status: needs committer review PR needs a review from the committer team label Feb 7, 2026
@manishdait manishdait marked this pull request as ready for review February 7, 2026 02:21
@manishdait manishdait requested review from a team as code owners February 7, 2026 02:21
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 7, 2026

Walkthrough

Adds optional timeout propagation to several Query subclass execute() methods and corrects docstring type-annotation typos; updates CHANGELOG to note timeout propagation.

Changes

Cohort / File(s) Summary
CHANGELOG
CHANGELOG.md
Added entry documenting that Query sub-class execute() methods now propagate the optional timeout parameter.
Query subclasses (timeout propagation)
src/hiero_sdk_python/account/account_records_query.py, src/hiero_sdk_python/contract/contract_bytecode_query.py, src/hiero_sdk_python/file/file_contents_query.py, src/hiero_sdk_python/file/file_info_query.py, src/hiero_sdk_python/schedule/schedule_info_query.py
Added optional timeout: Optional[Union[int, float]] = None to execute() signatures, updated typing imports to include Union, forwarded timeout into internal _execute() calls, and updated docstrings.
Docstring/type fixes (no behavioral change)
src/hiero_sdk_python/contract/contract_call_query.py, src/hiero_sdk_python/contract/contract_info_query.py, src/hiero_sdk_python/query/account_info_query.py, src/hiero_sdk_python/query/account_balance_query.py, src/hiero_sdk_python/query/token_info_query.py, src/hiero_sdk_python/query/token_nft_info_query.py, src/hiero_sdk_python/query/topic_info_query.py, src/hiero_sdk_python/query/transaction_get_receipt_query.py, src/hiero_sdk_python/query/transaction_record_query.py
Fixed/corrected timeout type annotations and minor docstring formatting in execute() docstrings. No signature or runtime behavior changes.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Caller
    participant Query as Query Subclass
    participant Client as Client
    participant Exec as _execute / Transport

    Caller->>Query: execute(client, timeout)
    Query->>Client: prepare/validate request
    Query->>Exec: _execute(client, timeout)
    Exec->>Client: send request (network)
    Client-->>Exec: response
    Exec-->>Query: return response
    Query-->>Caller: return parsed result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding missing timeout support to execute() implementations in Query sub-classes, which matches the changeset content.
Description check ✅ Passed The description is fully related to the changeset, explaining that timeout support was introduced in PR #1499 but not consistently propagated, and this PR fixes that.
Linked Issues check ✅ Passed The PR fully addresses issue #1735 by adding timeout parameter propagation to all affected Query sub-class execute() methods: AccountRecordsQuery, ContractBytecodeQuery, FileContentsQuery, FileInfoQuery, and ScheduleInfoQuery.
Out of Scope Changes check ✅ Passed All changes are in-scope: timeout parameter additions to query classes, docstring improvements, and import updates (Union type). The docstring fixes in multiple files are minor corrections related to the timeout implementation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

exploreriii
exploreriii previously approved these changes Feb 7, 2026
@exploreriii exploreriii added status: awaiting merge and removed status: needs committer review PR needs a review from the committer team labels Feb 7, 2026
Adityarya11
Adityarya11 previously approved these changes Feb 7, 2026
Copy link
Contributor

@Adityarya11 Adityarya11 left a comment

Choose a reason for hiding this comment

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

LGTM!

@exploreriii
Copy link
Contributor

Request step security help please @hiero-ledger/security-maintainers

Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
Signed-off-by: Manish Dait <daitmanish88@gmail.com>
@manishdait manishdait force-pushed the chore/missing-timeout-param branch from 061546b to e292f1a Compare February 8, 2026 06:55
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

- Fixed incorrect run instructions and broaden error handling in `token_dissociate_transaction.py` example to improve usability for new users (#1468)
- Update `.github/scripts/bot-advanced-check.sh` to unassign unqualified users.
- Fixed broken project structure link in `CONTRIBUTING.md` (#1664)
- Ensure all Query sub-class `execute()` function to correctly propagate the optional `timeout` parameter.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor grammar issue and missing issue reference in changelog entry.

The entry reads slightly awkwardly. Consider rewording for grammatical consistency with other entries in the "Fixed" section, and adding the issue reference for traceability.

Suggested fix
-- Ensure all Query sub-class `execute()` function to correctly propagate the optional `timeout` parameter.
+- Fixed all Query sub-class `execute()` functions to correctly propagate the optional `timeout` parameter. (`#1735`)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Ensure all Query sub-class `execute()` function to correctly propagate the optional `timeout` parameter.
- Fixed all Query sub-class `execute()` functions to correctly propagate the optional `timeout` parameter. (`#1735`)

Signed-off-by: Manish Dait <daitmanish88@gmail.com>
@manishdait manishdait dismissed stale reviews from exploreriii and Adityarya11 via f060927 February 8, 2026 07:15
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1


import traceback
from typing import List, Optional
from typing import List, Optional, Union
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Nit: typing.List is deprecated in favor of built-in list (Python 3.9+).

Ruff UP035 flags this. However, since the entire codebase consistently uses typing.List, this is fine to keep for now. Consider a codebase-wide migration as a separate task.

🧰 Tools
🪛 Ruff (0.14.14)

[warning] 6-6: typing.List is deprecated, use list instead

(UP035)

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

Hi, this is MergeConflictBot.
Your pull request cannot be merged because it contains merge conflicts.

Please resolve these conflicts locally and push the changes.

Quick Fix for CHANGELOG.md Conflicts

If your conflict is only in CHANGELOG.md, you can resolve it easily using the GitHub web editor:

  1. Click on the "Resolve conflicts" button in the PR
  2. Accept both changes (keep both changelog entries)
  3. Click "Mark as resolved"
  4. Commit the merge

For all other merge conflicts, please read:

Thank you for contributing!

@exploreriii
Copy link
Contributor

@manishdait please rebase, i think step security is now passing

@exploreriii exploreriii added status: needs developer revision PR has requested changes that the developer needs to implement and removed help needed: step security team labels Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: awaiting merge status: needs developer revision PR has requested changes that the developer needs to implement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add missing timeout support for execute() implementations in Query sub-classes

3 participants