# sql = 'select date from date_20_to_30 where year=2023'
# cursor.execute(sql)
# count_list = cursor.fetchall()
# v = 0
# # print(count_list[1])
# date_list = []
# for i in count_list:
# date_list.append(i[0])
# i = 0
# for data in date_list:
# i+=1
# # # 按年
# sql1 = f"create table us_self_product_detail_2023_{str(data).replace('-','_')} partition of us_self_product_detail_2023 for values from ('{str(data)}') to ('{str(date_list[i])}');"
# print(sql1)
# #
# # 'create table us_aba_profit_gross_day_2023_05_01 partition of us_aba_profit_gross_day_2023_05 for values from ('2023-05-01') to ('2023-05-02');'
# # moth = str(data).split('-')[1] 按 月分表
# # print(moth)
# sql1 = f"-- create table us_aba_profit_gross_day_{str(data).replace('-','_')} partition of us_aba_profit_gross_day_2023_{moth} for values from ('{str(data)}') to ('{str(date_list[i])}');"
sql_read="SELECT text_name FROM censored_thesaurus WHERE data_type='负面词汇'"
print(sql_read)
df=pd.read_sql(sql_read,con=self.engine)
self.text_list=list(df.text_name)
print('负面词汇:',self.text_list)
# asin_sql = f"SELECT asin,sku,erp_seller,{self.site_name}_upload_info,title,`describe` as describe_str ,selling from {self.site_name}_erp_asin_syn WHERE created_at>='2023-05-11' and asin_type=1;"
asin_sql=f"SELECT asin,sku,erp_seller,{self.site_name}_upload_info,title,`describe` as describe_str ,selling,is_variation,fulFillable from {self.site_name}_erp_asin_syn WHERE created_at>='2023-05-11';"
asin__detail_sql=f"SELECT asin,title,img_num,`describe`,category,page_inventory,search_category,product_description,img_type from {self.site_name}_self_asin_detail WHERE site='{self.site_name}' and created_at>='{self.time_strftime}' and asin in {asin_tuple};"
# sql_update = f"UPDATE {site_name}_count_request_data SET asin_request_err_total={list_data[1]},code_err_total={list_data[0]},success_asin_total={list_data[2]},request_total_count={list_data[3]},hour_asin_total='{hour_data_json}',asin_column_json='{asin_column_json}' where date_info='{new_date}'"
f"UPDATE {table_name} SET upload_time = :upload_time WHERE account_id = :account_id AND image_id = :image_id AND created_time < '2024-09-02 00:00:00'")