Resolved issues related to key error

This commit is contained in:
ArpitShukla007 2022-06-22 13:49:58 +00:00
parent 31cb0395e8
commit 8b84d99818
2 changed files with 3 additions and 2 deletions

View File

@ -171,7 +171,7 @@ def get_assets(connection, assets_ids: list) -> list:
asset = get_asset(connection, _id)
_returned_data.append(asset)
return sorted(_returned_data, key=lambda k: k["id"], reverse=False)
return sorted(_returned_data, key=lambda k: ("id" not in k, k.get("id", None)), reverse=False)
@register_query(TarantoolDBConnection)

View File

@ -693,7 +693,8 @@ class Transaction(object):
assets = list(planet.get_assets(tx_ids))
for asset in assets:
if asset is not None:
tx = tx_map[asset[1]]
if 'id' in asset:
tx = tx_map[asset['id']]
tx['asset'] = asset
tx_ids = list(tx_map.keys())