mirror of
https://github.com/AllSpiceIO/cofactr-cogs.git
synced 2025-04-18 07:48:55 +00:00
Merge pull request #3 from AllSpiceIO/jt/types
fix: Fix to pass mypy type-checking
This commit is contained in:
commit
d544b05d78
@ -61,8 +61,8 @@ def fetch_price_for_part(part_number: str) -> dict[int, float]:
|
||||
params={
|
||||
"q": part_number,
|
||||
"schema": "product-offers-v0",
|
||||
"external": True,
|
||||
"limit": 1,
|
||||
"external": "true",
|
||||
"limit": "1",
|
||||
},
|
||||
)
|
||||
|
||||
@ -149,8 +149,6 @@ if __name__ == "__main__":
|
||||
print("No prices found for any parts", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
cogs_for_quantities = {}
|
||||
|
||||
headers = [
|
||||
"Part Number",
|
||||
"Quantity",
|
||||
@ -161,7 +159,7 @@ if __name__ == "__main__":
|
||||
headers.append(f"Total at {quantity}")
|
||||
|
||||
rows = []
|
||||
totals = {quantity: 0 for quantity in quantities}
|
||||
totals: dict[int, float] = {quantity: 0 for quantity in quantities}
|
||||
|
||||
for part in parts:
|
||||
part_number = part[part_number_column]
|
||||
@ -199,7 +197,7 @@ if __name__ == "__main__":
|
||||
totals_row = ["Totals", None]
|
||||
for quantity in quantities:
|
||||
totals_row.append(None)
|
||||
totals_row.append(totals[quantity])
|
||||
totals_row.append(str(totals[quantity]))
|
||||
|
||||
writer.writerow(totals_row)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user