Skip to content

Commit ed5f744

Browse files
author
Roman
committed
extend annotation in get_metagraph_info
1 parent 4640d49 commit ed5f744

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

bittensor/core/async_subtensor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,9 @@ async def get_minimum_required_stake(self):
15451545
async def get_metagraph_info(
15461546
self,
15471547
netuid: int,
1548-
field_indices: Optional[list["SelectiveMetagraphIndex"]] = None,
1548+
field_indices: Optional[
1549+
Union[list["SelectiveMetagraphIndex"], list[int]]
1550+
] = None,
15491551
block: Optional[int] = None,
15501552
block_hash: Optional[str] = None,
15511553
reuse_block: bool = False,
@@ -1555,8 +1557,8 @@ async def get_metagraph_info(
15551557
15561558
Arguments:
15571559
netuid: The NetUID of the subnet to query.
1558-
field_indices: An optional list of SelectiveMetagraphIndex values specifying which fields to retrieve. If
1559-
not provided, all available fields will be returned.
1560+
field_indices: An optional list of SelectiveMetagraphIndex or int values specifying which fields to retrieve.
1561+
If not provided, all available fields will be returned.
15601562
block: the block number at which to retrieve the hyperparameter. Do not specify if using block_hash or
15611563
reuse_block
15621564
block_hash: The hash of blockchain block number for the query. Do not specify if using

bittensor/core/subtensor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,16 +1194,18 @@ def get_minimum_required_stake(self) -> Balance:
11941194
def get_metagraph_info(
11951195
self,
11961196
netuid: int,
1197-
field_indices: Optional[list[Union["SelectiveMetagraphIndex", int]]] = None,
1197+
field_indices: Optional[
1198+
Union[list["SelectiveMetagraphIndex"], list[int]]
1199+
] = None,
11981200
block: Optional[int] = None,
11991201
) -> Optional[MetagraphInfo]:
12001202
"""
12011203
Retrieves full or partial metagraph information for the specified subnet (netuid).
12021204
12031205
Arguments:
12041206
netuid: The NetUID of the subnet to query.
1205-
field_indices: An optional list of SelectiveMetagraphIndex values specifying which fields to retrieve. If
1206-
not provided, all available fields will be returned.
1207+
field_indices: An optional list of SelectiveMetagraphIndex or int values specifying which fields to retrieve.
1208+
If not provided, all available fields will be returned.
12071209
block: The block number at which to query the data. If not specified, the current block or one determined
12081210
via reuse_block or block_hash will be used.
12091211

0 commit comments

Comments
 (0)