add dict annotation

This commit is contained in:
poka 2023-09-13 09:06:44 +02:00
parent 1737080b82
commit cb7037072e
1 changed files with 4 additions and 4 deletions

View File

@ -42,7 +42,7 @@ class GeolocProfiles(CesiumCommon):
) )
scroll_id = response.json()["_scroll_id"] scroll_id = response.json()["_scroll_id"]
finalResult = response.json()["hits"]["hits"] finalResult: dict | None = response.json()["hits"]["hits"]
while True: while True:
# Send a scroll request to get the next page # Send a scroll request to get the next page
@ -77,14 +77,14 @@ class GeolocProfiles(CesiumCommon):
def formatProfiles(self, cesiumProfiles, gvaProfiles): def formatProfiles(self, cesiumProfiles, gvaProfiles):
walletsResult = [] walletsResult = []
for profile in cesiumProfiles: for profile in cesiumProfiles:
source = profile["_source"] source: dict = profile["_source"]
pubkey = profile["_id"] pubkey: dict = profile["_id"]
if pubkey not in gvaProfiles: if pubkey not in gvaProfiles:
continue continue
# Extract necessary information from the profiles # Extract necessary information from the profiles
id_info = gvaProfiles[pubkey].get("id") or {} id_info: dict = gvaProfiles[pubkey].get("id") or {}
isMember = id_info.get("isMember", False) isMember = id_info.get("isMember", False)
userId = id_info.get("username") userId = id_info.get("username")
title = source.get("title") title = source.get("title")