added conditional to check if item id in both item_id_results_list and in local file to eliminate variations listings including written data
This commit is contained in:
parent
47b77600a5
commit
904014ea38
@ -45,12 +45,12 @@ class FindingApi:
|
||||
try:# TODO run pdb here to see how to extract itemId before update_df
|
||||
training = pd.read_csv('training.csv')
|
||||
for item in data['findItemsByCategoryResponse'][0]['searchResult'][0]['item']:
|
||||
if item not in training.values not in itemid_results_list:# TODO need to figure out syntax to check if item_id is present in both list and training set. (list to avoid repeat results)
|
||||
if (item not in training.values) and (item not in itemid_results_list):
|
||||
itemid_results_list.append(item['itemId'][0]) # itemId
|
||||
# values are in lists for some reason
|
||||
except (pd.errors.EmptyDataError, FileNotFoundError):
|
||||
for item in data['findItemsByCategoryResponse'][0]['searchResult'][0]['item']:
|
||||
if item not in itemid_results_list:
|
||||
if (item not in training.values) and (item not in itemid_results_list):
|
||||
itemid_results_list.append(item['itemId'][0])
|
||||
item_id_results = [','.join(itemid_results_list[n:n+20]) for n in list(range(0,
|
||||
len(itemid_results_list), 20))]
|
||||
|
Loading…
Reference in New Issue
Block a user