Skip to content

improve (async) query map result#266

Merged
thewhaleking merged 5 commits intostagingfrom
feat/thewhaleking/improve-query-map-result
Feb 13, 2026
Merged

improve (async) query map result#266
thewhaleking merged 5 commits intostagingfrom
feat/thewhaleking/improve-query-map-result

Conversation

@thewhaleking
Copy link
Collaborator

  1. ensures that self.records is updated when the (Async)QueryMapResult is iterated over. Previously only the initial set of records was ever available, so running:
qm = QueryMapResult(page_size=10)

for item in qm:
    pass  # let's say this iterates 100 times

# before
print(len(qm.records))  # would still just print 10, and it would be the initial records

# now
print(len(qm.records))  # would print 100
  1. adds retrieve_all_records method to (Async)QueryMapResult — basically a convenience method that allows one to "fully exhaust" all pages and have them returned all at once. While await substrate.query_map(fully_exhaust=True) can achieve the same goal for AsyncSubstrateInterface, there's no good method like this for sync, and this doesn't cause a massive gathering, like what would happen in the case of fully_exhaust=True

  2. Adds unit tests

@thewhaleking thewhaleking requested a review from a team February 10, 2026 15:04
@thewhaleking thewhaleking added the enhancement New feature or request label Feb 10, 2026
@github-actions github-actions bot added run-bittensor-cli-tests Runs BTCLI tests. run-bittensor-sdk-tests Runs Bittensor SDK tests. labels Feb 10, 2026
@thewhaleking
Copy link
Collaborator Author

Test failures:
❌ An unknown error has occurred: Storage function "Swap.AlphaSqrtPrice" not found

This is unrelated to the PR, and is related to devnet-ready changing.

@thewhaleking thewhaleking merged commit 9f2d67e into staging Feb 13, 2026
152 of 164 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request run-bittensor-cli-tests Runs BTCLI tests. run-bittensor-sdk-tests Runs Bittensor SDK tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants