Commit 0436bc65 by chenyuanjie

ES异常销量置为0

parent bcfc0971
...@@ -67,7 +67,7 @@ class EsUpdate(object): ...@@ -67,7 +67,7 @@ class EsUpdate(object):
self.df_need_update = self.df_asin.join( self.df_need_update = self.df_asin.join(
self.df_es_asin, on=['asin'], how='inner' self.df_es_asin, on=['asin'], how='inner'
).withColumn( ).withColumn(
'asin_bought_month', F.lit(None) 'asin_bought_month', F.lit(0)
).cache() ).cache()
print("ES待更新的数据量为:", self.df_need_update.count()) print("ES待更新的数据量为:", self.df_need_update.count())
print(f"正在更新ES数据,更新索引:{self.index_name}") print(f"正在更新ES数据,更新索引:{self.index_name}")
...@@ -77,7 +77,7 @@ class EsUpdate(object): ...@@ -77,7 +77,7 @@ class EsUpdate(object):
.options(**self.es_options) \ .options(**self.es_options) \
.mode("append") \ .mode("append") \
.save() .save()
print(f"ES{self.index_name}索引更新完毕!") print(f"ES {self.index_name} 索引更新完毕!")
except Exception as e: except Exception as e:
print("An error occurred while writing to Elasticsearch:", str(e)) print("An error occurred while writing to Elasticsearch:", str(e))
CommonUtil.send_wx_msg(['chenyuanjie'], '\u26A0 ES月销数据更新失败', f'失败索引:{self.index_name}') CommonUtil.send_wx_msg(['chenyuanjie'], '\u26A0 ES月销数据更新失败', f'失败索引:{self.index_name}')
......
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