Commit fe4ee8a3 by fangxingjun

no message

parent cd7680e3
......@@ -106,7 +106,7 @@ class DimAsinDetail(object):
df_loc = df.loc[df.id == int(cur_id) - 21]
week4 = list(df_loc.year_week)[0]
complete_date_info_tuple = (week1, week2, week3, week4)
elif self.date_type in ['month', 'month_week']:
elif self.date_type in ['month', 'month_week', 'month_aba_me']:
df_loc = df.loc[(df.year_month == f"{self.date_info}") & (df.week_day == 1)]
complete_date_info_tuple = tuple(df_loc.year_week)
print("self.complete_date_info_tuple:", complete_date_info_tuple)
......@@ -211,7 +211,7 @@ class DimAsinDetail(object):
"category_first_name", F.lower("category_first_name")
).repartition(100).persist(StorageLevel.DISK_ONLY)
self.df_asin_category.show(10, truncate=False)
if self.date_type in ['month', 'month_week'] and self.date_info < '2024-06':
if self.date_type in ['month', 'month_week', 'month_aba_me'] and self.date_info < '2024-06':
sql = f"""
SELECT asin, parent_asin, color as asin_color, `size` as asin_size, style as asin_style,
CASE WHEN state = 1 THEN 1 WHEN state = 2 THEN 0 ElSE NULL END as asin_is_sale, updated_time
......@@ -301,7 +301,7 @@ class DimAsinDetail(object):
# 处理asin的配送方式信息
def handle_asin_buy_box_seller_type(self):
if (self.date_type in ['month', 'month_week'] and self.date_info >= '2024-05') \
if (self.date_type in ['month', 'month_week', 'month_aba_me'] and self.date_info >= '2024-05') \
or (self.date_type == '4_week' and self.date_info >= '2024-21'):
self.df_asin_detail = self.df_asin_detail.withColumn(
'seller_json',
......@@ -443,7 +443,7 @@ class DimAsinDetail(object):
# 处理asin小图信息
def handle_asin_img_info(self):
if self.date_type in ['month', 'month_week'] and self.date_info >= '2024-06':
if self.date_type in ['month', 'month_week', 'month_aba_me'] and self.date_info >= '2024-06':
img_schema = ArrayType(ArrayType(StringType()))
df_asin_with_img = self.df_asin_detail.withColumn("img_list", F.from_json(F.col("img_list"), img_schema)).filter(F.size("img_list") > 0).\
select("asin", F.explode("img_list").alias("img_attributes")).\
......@@ -459,7 +459,7 @@ class DimAsinDetail(object):
# 处理parent_asin下最新变体信息
def handle_latest_variation_info(self):
if self.date_type in ['month', 'month_week'] and self.date_info >= '2024-06':
if self.date_type in ['month', 'month_week', 'month_aba_me'] and self.date_info >= '2024-06':
max_report_sql = f"""
SELECT MAX(date_info) as table_date_info FROM {self.doris_db}.{self.parent_asin_latest_detail_table}
"""
......
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