I ran the code after I updated the adgroup and merchant ids. The new product partition appear in the Adwords UI however the script is outputting the following error:
Traceback (most recent call last):
File "shopping_adgroup.py", line 207, in <module>
main(adwords_client, ADGROUP_ID)
File "shopping_adgroup.py", line 162, in main
children[adgroup_criterion['criterion']['parentCriterionId']].append(
KeyError: None