This commit is contained in:
parent
64897392f1
commit
94a3a517c7
@ -347,13 +347,8 @@ class PricingService:
|
|||||||
|
|
||||||
price_lookup = self.get_all_prices_for_products(df['product_id'].unique())
|
price_lookup = self.get_all_prices_for_products(df['product_id'].unique())
|
||||||
|
|
||||||
# Convert the nested dict to a DataFrame
|
# Apply price columns
|
||||||
price_df = pd.DataFrame.from_dict(price_lookup, orient='index') # product_id becomes index
|
df = df.apply(lambda row: self.apply_price_to_df_columns(row, price_lookup), axis=1)
|
||||||
price_df.index.name = 'product_id'
|
|
||||||
price_df.reset_index(inplace=True)
|
|
||||||
|
|
||||||
# Merge onto your main DataFrame
|
|
||||||
df = df.merge(price_df, on='product_id', how='left')
|
|
||||||
|
|
||||||
logger.debug(f"Applying pricing algorithm: {ACTIVE_PRICING_ALGORITHIM}")
|
logger.debug(f"Applying pricing algorithm: {ACTIVE_PRICING_ALGORITHIM}")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user