Skip to content

[Good First Issue]: Add missing return type annotation to _is_payment_required() in CryptoGetAccountBalanceQueryย #2059

@rwalworth

Description

@rwalworth

๐Ÿ†•๐Ÿฅ Newcomer Friendly

This Good First Issue is a guided, well-scoped task intended for new human contributors to the Hiero Python SDK.

What you'll do

  • โœ… understand how the repository is structured
  • โœ… practice the standard contribution workflow
  • โœ… submit and merge a pull request

Support

A maintainer or mentor actively monitors this issue and will help guide it to completion.

Important

This issue does not require prior domain knowledge.

  • No Hiero or Hedera experience needed
  • No distributed ledger background required
  • Basic Python and Git are sufficient

Note

โฑ๏ธ Typical time to complete: 30โ€“90 minutes (once setup is done)
๐Ÿงฉ Difficulty: Small, well-contained change
๐ŸŽ“ Best for: New contributors

๐Ÿ Completion
When this issue is complete, you will have:

  • โœ… Solved a real issue
  • โœ… A merged pull request in the Hiero Python SDK
  • โœ… Your name in the project history
  • โœ… Confidence to take on larger issues next

Important

๐Ÿ“‹ Good First Issue (GFI) Guidelines

A Good First Issue Guidelines is a small, well-scoped task that helps new contributors get familiar with the codebase and contribution workflow.

Often a good fit for Good First Issues:

  • Spelling or grammar fixes
  • Small documentation formatting improvements
  • Purely structural refactors of examples
  • Minor, clearly described edits to docstrings or comments
  • Adding missing return type hints when the expected type is explicitly stated

More involved tasks may be a better fit for Beginner, Intermediate, or Advanced issues.

If you're unsure, the Good First Issue Candidate Template can be used.


๐Ÿ‘พ Issue description

The file src/hiero_sdk_python/query/account_balance_query.py contains the CryptoGetAccountBalanceQuery class. Every public and private method in this class has a complete return type annotation โ€” except one.

The _is_payment_required() method at line 180 is missing its -> bool return type annotation:

# Current (missing annotation):
def _is_payment_required(self):
    """
    Account balance query does not require payment.

    Returns:
        bool: False
    """
    return False

All other methods in the same file already have return type annotations. For example:

def set_account_id(self, account_id: AccountId) -> "CryptoGetAccountBalanceQuery":
def _make_request(self) -> query_pb2.Query:
def _get_method(self, channel: _Channel) -> _Method:
def execute(self, client: Client, timeout: Optional[Union[int, float]] = None) -> AccountBalance:

The return type of _is_payment_required() is unambiguous โ€” it always returns False, which is a bool. The docstring already documents this. The fix is to add -> bool to the method signature.


๐Ÿ’ก Proposed Solution

Add the -> bool return type annotation to the _is_payment_required() method signature in src/hiero_sdk_python/query/account_balance_query.py. The exact change is specified in the Implementation Steps below โ€” no interpretation is required.


๐Ÿ› ๏ธ Implementation Steps

File to change: src/hiero_sdk_python/query/account_balance_query.py

Location: Line 180 โ€” the _is_payment_required() method definition

Change: Add -> bool to the method signature. The before and after are:

# Before (line 180):
def _is_payment_required(self):

# After:
def _is_payment_required(self) -> bool:

The full updated method will look like this:

def _is_payment_required(self) -> bool:
    """
    Account balance query does not require payment.

    Returns:
        bool: False
    """
    return False

Steps:

  • Open src/hiero_sdk_python/query/account_balance_query.py
  • Find _is_payment_required at line 180
  • Change def _is_payment_required(self): to def _is_payment_required(self) -> bool:
  • Do not change the docstring, the body, or anything else in the file
  • Run the existing unit tests to confirm nothing is broken: uv run pytest tests/unit/test_account_balance_query.py (if the test file exists), or uv run pytest for the full suite

๐Ÿ“‹ Step-by-Step Setup Guide

Suggestions:

  • Visual Studio (VS) Code: Guide

  • GitHub Desktop: Guide

  • Hedera Testnet Account with root .env file: Guide

  • Create a GPG key linked to GitHub: Guide

Setup the Hiero Python SDK for development

  • Fork Create an online and local copy of the repository: Guide

  • Connect origin with upstream: Guide

  • Install Packages and protobufs: Guide (or Windows Setup Guide for Windows users)

  • Sync Main pull any recent upstream changes: Guide

You are set up! ๐ŸŽ‰


๐Ÿ“‹ Step-by-step contribution guide

โœ… Get ready

  • Claim the issue: comment /assign: Guide. Pull requests created without being assigned will be automatically closed.

  • Double check the Issue and AI plan: carefully re-read the issue description and the CodeRabbit AI plan

  • Ask questions early: ask on Discord, your @mentor (Python SDK help) and the @good_first_issue_support_team (setup and workflow help)

  • Sync with main: pull the latest upstream changes Guide

  • ๐Ÿ’ก Tip: Before coding, leave a short comment describing what you plan to change. We'll confirm you're on the right track.

๐Ÿ› ๏ธ Solve the Issue

  • Create a branch from main: Guide

  • Implement the solution: follow the implementation steps in the issue description.

  • Commit with DCO and GPG signing: commit changes using: git commit -S -s -m "chore: add return type annotation to _is_payment_required in CryptoGetAccountBalanceQuery", Guide

  • Add a .CHANGELOG.md entry: under the appropriate [UNRELEASED] section and commit as git commit -S -s -m "chore: changelog entry" Guide

๐Ÿš€ Create the pull request

  • Push your commits: push your branch to your fork git push origin your-branch-name

  • Open a pull request: here guide

  • Complete the PR description: briefly describe your changes, Guide

  • Link the Issue: link the issue the PR solves in the PR description, Guide. Pull requests created without a linked issue will be automatically closed.

  • Submit the pull request: click **Create pull request** ๐ŸŽ‰


โœ… Acceptance criteria

To be able to close this issue, the following criteria must be met:

  • The issue is solved: _is_payment_required() in src/hiero_sdk_python/query/account_balance_query.py has the -> bool return type annotation on its def line

  • I did not add extra changes: No other methods, files, or lines were modified

  • Behavior: The SDK behavior is unchanged โ€” only the type annotation was added

  • Tests pass: All existing tests continue to pass

  • Checks and feedback: All CI checks pass and any requested changes have been made


๐Ÿงญ Getting help if you're stuck

If questions come up, don't spend more than 20 minutes blocked.

Tip

  • Comment on this issue and tag @good_first_issue_support_team or @mentor_name
  • Ask for help in Discord

๐Ÿค” What to expect after submitting a PR

Once you open a pull request, here's what happens next.

๐Ÿค– 1. Automated checks
A small set of automated checks must pass before merging (signing, changelog, tests, examples, code quality).
Open any failed check to see details.


๐Ÿค 2. AI feedback (CodeRabbit)
CodeRabbit AI may suggest improvements or flag issues.
Feedback is advisory โ€” use what's relevant and helpful.


๐Ÿ˜Ž 3. Team review
A Python SDK team member reviews your PR within 1โ€“3 days.
You may be asked to make changes or your PR may be approved.
Approved PRs are usually merged within one day.

๐Ÿ”„ Merge conflicts (sometimes)
Conflicts can happen and are normal as the SDK updates.
Changelog conflicts can be resolved online in the PR in the merge editor, accepting both entries.
Others may require rebasing.


๐Ÿค– AI usage guidelines

Humans are welcome to use AI tools while working on this issue but we do not accept AI bot-authored PRs.

Use AI responsibly:

  • review suggestions carefully
  • apply changes incrementally
  • test as you go

If in doubt, ask โ€” maintainers are happy to help.


๐Ÿค” Additional Help

First Points of Contact:

  • Discord
  • Comment with @mentor_name (for Python SDK questions)
  • Comment with @hiero-ledger/hiero-sdk-good-first-issue-support (for setup and workflow questions)
    The more you ask, the more you learn and so do we!

Documentation:

Calls:

Metadata

Metadata

Labels

Good First IssueIssues which are ideal for a first time or new project contributor.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    โšก