From 7d68a93d04c451392efdf14affa99c349d6df9f8 Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Sat, 18 Jun 2022 13:57:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8C=85=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ dags/poi/business/district_bank.py | 2 +- dags/poi/district_bank_dag.py | 3 +-- install.sh | 1 + requirements.txt | 1 - 5 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 install.sh diff --git a/README.md b/README.md index 415b0d8..5ba9e66 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ ##### 1. 依赖安装 +./install.sh +或 pip install -r requirements.txt -i https://repo.fangjia.com/repository/pypi-public/simple/ ##### 2. 具体业务逻辑 diff --git a/dags/poi/business/district_bank.py b/dags/poi/business/district_bank.py index c46dc05..aa7d10f 100644 --- a/dags/poi/business/district_bank.py +++ b/dags/poi/business/district_bank.py @@ -76,7 +76,6 @@ def find_around_by_location(city, location): def deal(city, lng, lat): - print('开始查找' + city + '周边银行') if lng != None: location = [lng, lat] bank_df = find_around_by_location(city, location) @@ -84,6 +83,7 @@ def deal(city, lng, lat): return [] +print('开始查找' + city + '周边银行') seaweed_df['bank'] = seaweed_df.apply(lambda x: deal(x['city'], x['lng'], x['lat']), axis=1) actions = list() diff --git a/dags/poi/district_bank_dag.py b/dags/poi/district_bank_dag.py index fde8191..db9fbd7 100644 --- a/dags/poi/district_bank_dag.py +++ b/dags/poi/district_bank_dag.py @@ -7,7 +7,6 @@ import pendulum from airflow import DAG - with DAG( "district_bank_dag", schedule_interval="@monthly", @@ -16,7 +15,7 @@ with DAG( ) as dag: t1 = BashOperator( task_id='district_bank', - bash_command='business/district_bank.py', + bash_command='python /opt/airflow/dags/repo/dags/poi/business/district_bank.py', ) t1 diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..525a105 --- /dev/null +++ b/install.sh @@ -0,0 +1 @@ +pip install -r requirements.txt -i https://repo.fangjia.com/repository/pypi-public/simple/ \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 59c36ff..2a8ad69 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ -apache-airflow goojia_utils \ No newline at end of file