修复美团m_date报错
This commit is contained in:
@@ -153,6 +153,7 @@ def complete_by_round_area(community_factor_df):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def sync(city=None):
|
def sync(city=None):
|
||||||
log.info(f"开始补全户均总价信息至206 {index_name}")
|
log.info(f"开始补全户均总价信息至206 {index_name}")
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ output_date = sys.argv[1] if len(sys.argv) > 1 else dateutils.format_date(dateti
|
|||||||
print("输出日期" + output_date)
|
print("输出日期" + output_date)
|
||||||
|
|
||||||
result_df = tmp_ck.read_sql_query("select * from tmp.mt_community")
|
result_df = tmp_ck.read_sql_query("select * from tmp.mt_community")
|
||||||
|
del result_df['m_date']
|
||||||
|
|
||||||
city_df = pd.read_excel('/opt/airflow/dags/repo/dags/mt/supply/data/美团88城市列表.xlsx')
|
city_df = pd.read_excel('/opt/airflow/dags/repo/dags/mt/supply/data/美团88城市列表.xlsx')
|
||||||
cities = city_df['城市列表'].values.tolist()
|
cities = city_df['城市列表'].values.tolist()
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ month_start_date = dateutils.parse_date(month_start, '%Y%m%d')
|
|||||||
curr_month_start_date = dateutils.parse_date(curr_month_start, '%Y%m%d')
|
curr_month_start_date = dateutils.parse_date(curr_month_start, '%Y%m%d')
|
||||||
|
|
||||||
result_df = tmp_ck.read_sql_query("select * from mt_community")
|
result_df = tmp_ck.read_sql_query("select * from mt_community")
|
||||||
|
del result_df['m_date']
|
||||||
|
|
||||||
if 'deal_num' in result_df.columns:
|
if 'deal_num' in result_df.columns:
|
||||||
result_df = result_df.drop(columns=['deal_num'])
|
result_df = result_df.drop(columns=['deal_num'])
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ district_facilitys_new_df = district_facilitys_new_df.rename(columns={'district_
|
|||||||
district_facilitys_new_df = district_facilitys_new_df.drop_duplicates(subset=['city', 'region', 'name'], keep='first')
|
district_facilitys_new_df = district_facilitys_new_df.drop_duplicates(subset=['city', 'region', 'name'], keep='first')
|
||||||
|
|
||||||
result_df = tmp_ck.read_sql_query("select * from mt_community")
|
result_df = tmp_ck.read_sql_query("select * from mt_community")
|
||||||
|
del result_df['m_date']
|
||||||
|
|
||||||
if 'school' in result_df.columns:
|
if 'school' in result_df.columns:
|
||||||
result_df = result_df.drop(columns=['school', 'bank', 'hospital', 'market', 'subway'])
|
result_df = result_df.drop(columns=['school', 'bank', 'hospital', 'market', 'subway'])
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ path = "/home/airflow/data/mt"
|
|||||||
output_date = sys.argv[1] if len(sys.argv) > 1 else dateutils.format_date(datetime.datetime.now(), '%Y%m')
|
output_date = sys.argv[1] if len(sys.argv) > 1 else dateutils.format_date(datetime.datetime.now(), '%Y%m')
|
||||||
|
|
||||||
seaweed_new_result_df = tmp_ck.read_sql_query("select * from mt_community")
|
seaweed_new_result_df = tmp_ck.read_sql_query("select * from mt_community")
|
||||||
|
del seaweed_new_result_df['m_date']
|
||||||
|
|
||||||
if 'avg_price' in seaweed_new_result_df:
|
if 'avg_price' in seaweed_new_result_df:
|
||||||
seaweed_new_result_df = seaweed_new_result_df.drop(columns=['avg_price', 'rent_price'])
|
seaweed_new_result_df = seaweed_new_result_df.drop(columns=['avg_price', 'rent_price'])
|
||||||
|
|||||||
Reference in New Issue
Block a user