6
mirror of https://github.com/AllSpiceIO/cofactr-cogs.git synced 2025-04-18 07:48:55 +00:00

Remove defaults for BOM column names

This commit is contained in:
Jonathan Tran 2024-05-21 14:40:03 -04:00
parent 5a875823da
commit c331db38f8
No known key found for this signature in database
2 changed files with 15 additions and 9 deletions

View File

@ -12,9 +12,9 @@ inputs:
default: "1,10,100,1000"
bom_part_number_column:
description: >
The name of the part number column in the BOM file. Defaults to 'Part
Number'.
default: Part Number
The name of the part number column in the BOM file. You must provide
this.
default: ''
bom_manufacturer_column:
description: >
The name of the manufacturer column in the BOM file. Defaults to ''. If
@ -22,8 +22,8 @@ inputs:
default: ''
bom_quantity_column:
description: >
The name of the quantity column in the BOM file. Defaults to 'Quantity'.
default: Quantity
The name of the quantity column in the BOM file. You must provide this.
default: ''
search_strategy:
description: >
The Cofactr search strategy. Can be: "mpn_sku_mfr" or "fuzzy" (uses mpn).

View File

@ -31,8 +31,8 @@ def main() -> None:
)
parser.add_argument(
"--bom-part-number-column",
help="The name of the part number column in the BOM file. Defaults to '%(default)s'.",
default="Part Number",
help="The name of the part number column in the BOM file. You must provide this.",
default="",
)
parser.add_argument(
"--bom-manufacturer-column",
@ -42,8 +42,8 @@ def main() -> None:
)
parser.add_argument(
"--bom-quantity-column",
help="The name of the quantity column in the BOM file. Defaults to '%(default)s'.",
default="Quantity",
help="The name of the quantity column in the BOM file. You must provide this.",
default="",
)
parser.add_argument(
"--search-strategy",
@ -67,8 +67,14 @@ def main() -> None:
quantities = [int(quantity) for quantity in args.quantities.split(",")]
part_number_column = args.bom_part_number_column
if not part_number_column:
raise ValueError("BOM part number column needs to be specified.")
manufacturer_column = args.bom_manufacturer_column
quantity_column = args.bom_quantity_column
if not quantity_column:
raise ValueError("BOM quantity column needs to be specified.")
search_strategy = SearchStrategy(args.search_strategy)
with open(args.bom_file, "r") as bom_file: