asdf
All checks were successful
Deploy App to Docker / deploy (push) Successful in 33s

This commit is contained in:
zman 2025-04-12 13:27:43 -04:00
parent 0e5ba991db
commit 3199a3259f

View File

@ -296,12 +296,16 @@ class PricingService:
def apply_pricing_algo(self, row: pd.Series, pricing_algo: callable = None) -> pd.Series: def apply_pricing_algo(self, row: pd.Series, pricing_algo: callable = None) -> pd.Series:
"""Modified to handle the pricing algorithm as an instance method""" """Modified to handle the pricing algorithm as an instance method"""
if pricing_algo: if pricing_algo:
logger.debug(f"Using custom pricing algorithm: {pricing_algo.__name__}")
return pricing_algo(row) return pricing_algo(row)
elif ACTIVE_PRICING_ALGORITHIM == 'default_pricing_algo': elif ACTIVE_PRICING_ALGORITHIM == 'default_pricing_algo':
logger.debug(f"Using default pricing algorithm: {self.default_pricing_algo.__name__}")
pricing_algo = self.default_pricing_algo pricing_algo = self.default_pricing_algo
elif ACTIVE_PRICING_ALGORITHIM == 'tcgplayer_recommended_algo': elif ACTIVE_PRICING_ALGORITHIM == 'tcgplayer_recommended_algo':
logger.debug(f"Using TCGPlayer recommended algorithm: {self.tcgplayer_recommended_algo.__name__}")
pricing_algo = self.tcgplayer_recommended_algo pricing_algo = self.tcgplayer_recommended_algo
else: else:
logger.debug(f"Using default pricing algorithm: {self.default_pricing_algo.__name__}")
pricing_algo = self.default_pricing_algo pricing_algo = self.default_pricing_algo
return pricing_algo(row) return pricing_algo(row)
@ -345,6 +349,8 @@ class PricingService:
# Apply price columns # Apply price columns
df = df.apply(lambda row: self.apply_price_to_df_columns(row, price_lookup), axis=1) df = df.apply(lambda row: self.apply_price_to_df_columns(row, price_lookup), axis=1)
logger.debug(f"Applying pricing algorithm: {ACTIVE_PRICING_ALGORITHIM}")
# Apply pricing algorithm # Apply pricing algorithm
df = df.apply(self.apply_pricing_algo, axis=1) df = df.apply(self.apply_pricing_algo, axis=1)