Price cleaner should flag unrecognized formats instead of guessing amounts
A scraped price field can look clean after stripping non-digit characters, but this may distort its meaning, such as turning a range into a single number or a delivery fee into a price. The article recommends preserving the raw source value, deriving a separate amount, and attaching a status that downstream stages can inspect. It illustrates this with a narrow Python example that accepts only GBP amounts with exactly two decimal places and rejects ranges, grouped amounts, negatives, and other currencies. The author stresses that a value matching the grammar is not automatically the intended price, since parsing syntax does not establish business meaning. Missing inputs and unrecognized formats are kept distinct so that unmatched values remain available for review rather than being silently converted.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in