6
mirror of https://github.com/AllSpiceIO/cofactr-cogs.git synced 2025-04-10 22:50:08 +00:00

Fix to not include parts with empty prices

This commit is contained in:
Jonathan Tran 2024-05-23 16:39:31 -04:00
parent 934d7d57e0
commit de56ad5b80
No known key found for this signature in database

View File

@ -188,7 +188,7 @@ def main() -> None:
part_number = part[part_number_column]
manufacturer = part[manufacturer_column] if use_mfr else ""
part_prices = fetch_price_for_part(part_number, manufacturer, search_strategy)
if part_prices is not None:
if part_prices is not None and len(part_prices.prices) > 0:
prices_for_parts[(part_number, manufacturer)] = part_prices
print(f"Found prices for {len(prices_for_parts)} parts", file=sys.stderr)