Skip to content

Commit 52d77fe

Browse files
committed
Fix NaN payment_product_id in load_metadata_for_model - se HEA-851
1 parent a1fa77b commit 52d77fe

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

pipelines/jobs/metadata.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ def load_metadata_for_model(context: OpExecutionContext, sheet_name: str, model:
6262
df["is_start"] = df["is_start"].replace("", False)
6363
if "product_name" in df or "payment_product_name" in df:
6464
classifiedproductlookup = ClassifiedProductLookup(require_match=False)
65-
if "product_name" in df:
66-
df = classifiedproductlookup.do_lookup(df, "product_name", "product_id")
67-
if "payment_product_name" in df:
68-
df = classifiedproductlookup.do_lookup(df, "payment_product_name", "payment_product_id")
65+
if "product_name" in df:
66+
df = classifiedproductlookup.do_lookup(df, "product_name", "product_id")
67+
df["product_id"] = df["product_id"].astype(object).replace(pd.NA, None)
68+
if "payment_product_name" in df:
69+
df = classifiedproductlookup.do_lookup(df, "payment_product_name", "payment_product_id")
70+
df["payment_product_id"] = df["payment_product_id"].astype(object).replace(pd.NA, None)
6971
if "country_id" in df:
7072
df["country_id"] = df["country_id"].astype(object).replace(pd.NA, None)
71-
if "product_id" in df:
72-
df["product_id"] = df["product_id"].astype(object).replace(pd.NA, None)
7373
if "unit_of_measure_id" in df:
7474
df["unit_of_measure_id"] = df["unit_of_measure_id"].astype(object).replace("", None)
7575
if "currency_id" in df:

0 commit comments

Comments
 (0)