I am writing a lambda in python where I am searching elements within dictionary without exact match.
for security_data_item in security_list_per_prefix_raw_m:
investment_vehicle_id = security_data_item.get_investment_vehicle_id()
unique_id = investment_vehicle_id
ext_security_dict_keys = list(dict(filter(lambda item: item[0].startswith(unique_id),
security_dict.items())).keys())
When I am running this my lambda is getting time-out. security_dict will have too many items. I can not use exact match security_dict.get(unique_id)
Is there any better way I can search?
I also tried this ext_security_dict_keys = [val for key, val in security_dict.items() if re.search(unique_id, key)]