test updates to take into account exception management
This commit is contained in:
@@ -103,7 +103,8 @@ class PriceProcessor:
|
||||
"""
|
||||
Parse price string into (price, currency) tuple.
|
||||
|
||||
Returns (None, None) if parsing fails
|
||||
Raises ValueError if parsing fails for non-empty input.
|
||||
Returns (None, None) for empty/null input.
|
||||
"""
|
||||
if not price_str or pd.isna(price_str):
|
||||
return None, None
|
||||
@@ -136,5 +137,6 @@ class PriceProcessor:
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
logger.warning(f"Could not parse price: '{price_str}'")
|
||||
return price_str, None
|
||||
# If we get here, parsing failed completely
|
||||
logger.error(f"Could not parse price: '{price_str}'")
|
||||
raise ValueError(f"Invalid price format: '{price_str}'")
|
||||
|
||||
Reference in New Issue
Block a user