Skip to content

Commit 8c20b68

Browse files
committed
Add if-statement to print if no products found in function 'print_latest_datapoints_for_products'
1 parent b1c2deb commit 8c20b68

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scraper/print_products.py

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ def print_latest_datapoints(names: list[str], product_codes: list[str], categori
2222

2323

2424
def print_latest_datapoints_for_products(products: list[db.Product]):
25+
if not products:
26+
print("Found no products")
27+
return
28+
2529
grouped_products = db.group_products_by_names(products)
2630

2731
for products in grouped_products:

0 commit comments

Comments
 (0)