Commit 478b94ef authored by 邱阿朋's avatar 邱阿朋

fix(price_gui): 过滤价格字段非数值类型数据

- 在遍历数据行时,增加对价格字段的类型检查
- 跳过价格字段不是浮点数或整数的行,避免异常情况
- 确保价格数据有效性,提高数据处理稳定性

fix(gitignore): 添加csv文件类型忽略规则

- 在.gitignore文件中新增对*.csv文件的忽略配置
- 防止csv文件被误提交到版本库
parent c7e972fa
......@@ -8,6 +8,7 @@ spa
spa_pdf
refund
*.xlsx
*.csv
build
*.spec
payment
......
......@@ -175,6 +175,10 @@ class AmazonPriceScraper:
client.connect(queue='price_robot', routing_key='price_robot', exchange='product')
country = self.country_var.get()
for _, item_row in data.iterrows():
price = item_row.get('Price', 0)
if not isinstance(price, float) or not isinstance(price, int):
continue
push_data = {
'currency': country,
'asin': item_row.get('ASIN', ''),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment