So below is my code: I am getting none type object is not iterable error as append is not happening.
result_list_haops=[]
each_result={'name': 'ads-scin-tracking', 'monitoringGroup': 'HAOPS', 'azkabanInstance': 'lva1-war-waraz01', 'project': 'ads-metrics-pipeline', 'subscribers': ['ads-relevance@linkedin.com'], 'invalid_attribute': 'teamAskAlias', 'link': 'https://intake2.corp.linkedin.com:8767/#/flows/view/lva1-war-waraz01/ads-metrics-pipeline-ads-scin-tracking'}
group = each_result['monitoringGroup']
self.log.debug(group)
if group == "HAOPS":
result_list_haops = result_list_haops.append(each_result)
Later in my code,
result_grouped_by = sorted(result_list,key=itemgetter('subscribers'))
it throws Nonetype object is not iterable.
I am unable to find what is it I am doing wrong here.
Error i am getting: Nonetype object is not iterable
Desired behaviour:
result_list_haops=[{'name': 'ads-scin-tracking', 'monitoringGroup': 'HAOPS', 'azkabanInstance': 'lva1-war-waraz01', 'project': 'ads-metrics-pipeline', 'subscribers': ['ads-relevance@linkedin.com'], 'invalid_attribute': 'teamAskAlias', 'link': 'https://intake2.corp.linkedin.com:8767/#/flows/view/lva1-war-waraz01/ads-metrics-pipeline-ads-scin-tracking'}]
Please help me.