Commit 6743d708 authored by Margrenzo Gunawan's avatar Margrenzo Gunawan 💬

FDSSUPPORT

parent 795f9315
...@@ -136,7 +136,7 @@ def ds_csv_to_table(ti, copy_sql, file_id, **context): ...@@ -136,7 +136,7 @@ def ds_csv_to_table(ti, copy_sql, file_id, **context):
"WITH_DATE") == 'Y' else '') + f"""{file_id}.csv""") "WITH_DATE") == 'Y' else '') + f"""{file_id}.csv""")
with DAG("APJ_1_T24_EO", with DAG("APJ_FDS_T24",
start_date=datetime(2021, 1, 1), start_date=datetime(2021, 1, 1),
# schedule='0/30 * * * *', # schedule='0/30 * * * *',
schedule_interval=None, schedule_interval=None,
...@@ -163,10 +163,10 @@ with DAG("APJ_1_T24_EO", ...@@ -163,10 +163,10 @@ with DAG("APJ_1_T24_EO",
sftp_xx = BashOperator( # sftp_xx = BashOperator(
task_id="sftp_xx", # task_id="sftp_xx",
bash_command=f"""sshpass -p {Variable.get("SFTP_T24_PASSWORD")} sftp -o StrictHostKeyChecking=no -r {Variable.get("SFTP_T24_USER")}@{Variable.get("SFTP_T24_HOST")}:DFE/{yesterday_nodash}/ {Variable.get("LOCAL_PATH")}{DS_FOLDER}/""", # bash_command=f"""sshpass -p {Variable.get("SFTP_T24_FDS_PASSWORD")} sftp -o StrictHostKeyChecking=no -r {Variable.get("SFTP_T24_FDS_USER")}@{Variable.get("SFTP_T24_HOST")}:DFE/{yesterday_nodash}/ {Variable.get("LOCAL_PATH")}{DS_FOLDER}/""",
) # )
# ds_get_t24_extractor = SFTPOperator( # ds_get_t24_extractor = SFTPOperator(
# task_id="ds_get_t24_extractor", # task_id="ds_get_t24_extractor",
...@@ -312,7 +312,7 @@ with DAG("APJ_1_T24_EO", ...@@ -312,7 +312,7 @@ with DAG("APJ_1_T24_EO",
ds_nominatif = TriggerDagRunOperator( ds_nominatif = TriggerDagRunOperator(
task_id=f'ds_nominatif', task_id=f'ds_nominatif',
trigger_dag_id="APJ_1_t24_interface_backdate", trigger_dag_id="APJ_1_t24_interface_fdssupport",
) )
...@@ -342,4 +342,4 @@ with DAG("APJ_1_T24_EO", ...@@ -342,4 +342,4 @@ with DAG("APJ_1_T24_EO",
# postgres_conn_id=POSTGRES_CONN_ID, # postgres_conn_id=POSTGRES_CONN_ID,
# ) # )
begin >> check_done_ext >> sftp_xx >> check_file_done >> history_start >> file_sc_cp >> metadata_truncate >> metadata_sed >> metadata_list_extractor >> metadata_syntax_copy >> metadata_import >> metadata_refresh >> ds_create_table >> ds_list_extractor >> ds_syntax_copy >> ds_csv_to_table >> ds_create_metadata_file >> ds_create_metadata_file_sys >> set_access_schemma >> set_access_all_table >> ds_nominatif >> ds_remove_bnk >> ds_ext_done begin >> check_done_ext >> check_file_done >> history_start >> file_sc_cp >> metadata_truncate >> metadata_sed >> metadata_list_extractor >> metadata_syntax_copy >> metadata_import >> metadata_refresh >> ds_create_table >> ds_list_extractor >> ds_syntax_copy >> ds_csv_to_table >> ds_create_metadata_file >> ds_create_metadata_file_sys >> set_access_schemma >> set_access_all_table >> ds_nominatif >> ds_remove_bnk >> ds_ext_done
...@@ -101,7 +101,7 @@ def sql_clean_syntax(ti): ...@@ -101,7 +101,7 @@ def sql_clean_syntax(ti):
def stop_task(**kwargs): def stop_task(**kwargs):
return True return True
with DAG("APJ_1_t24_interface_backdate", with DAG("APJ_FDS_T24_Interface",
start_date=datetime(2021, 1, 1), start_date=datetime(2021, 1, 1),
schedule_interval=None, schedule_interval=None,
catchup=False, catchup=False,
...@@ -114,15 +114,15 @@ with DAG("APJ_1_t24_interface_backdate", ...@@ -114,15 +114,15 @@ with DAG("APJ_1_t24_interface_backdate",
} }
) )
sftp_xx = BashOperator( # sftp_xx = BashOperator(
task_id="sftp_xx", # task_id="sftp_xx",
bash_command=f"""sshpass -p {Variable.get("SFTP_T24_PASSWORD")} sftp -o StrictHostKeyChecking=no -r {Variable.get("SFTP_T24_USER")}@{Variable.get("SFTP_T24_HOST")}:/REPORT.BP/NOM/TREASURY/*{yesterday_nodash}* {Variable.get("LOCAL_PATH")}t24/{yesterday_nodash}/""", # bash_command=f"""sshpass -p {Variable.get("SFTP_T24_PASSWORD")} sftp -o StrictHostKeyChecking=no -r {Variable.get("SFTP_T24_USER")}@{Variable.get("SFTP_T24_HOST")}:/REPORT.BP/NOM/TREASURY/*{yesterday_nodash}* {Variable.get("LOCAL_PATH")}t24/{yesterday_nodash}/""",
) # )
sftp_ppap = BashOperator( # sftp_ppap = BashOperator(
task_id="sftp_ppap", # task_id="sftp_ppap",
bash_command=f"""sshpass -p {Variable.get("SFTP_T24_PASSWORD")} sftp -o StrictHostKeyChecking=no -r {Variable.get("SFTP_T24_USER")}@{Variable.get("SFTP_T24_HOST")}:/PPAP.NOMINATIF/*{yesterday_nodash}*COB.csv {Variable.get("LOCAL_PATH")}t24/{yesterday_nodash}/""", # bash_command=f"""sshpass -p {Variable.get("SFTP_T24_PASSWORD")} sftp -o StrictHostKeyChecking=no -r {Variable.get("SFTP_T24_USER")}@{Variable.get("SFTP_T24_HOST")}:/PPAP.NOMINATIF/*{yesterday_nodash}*COB.csv {Variable.get("LOCAL_PATH")}t24/{yesterday_nodash}/""",
) # )
# sftp_neraca = BashOperator( # sftp_neraca = BashOperator(
...@@ -298,4 +298,4 @@ with DAG("APJ_1_t24_interface_backdate", ...@@ -298,4 +298,4 @@ with DAG("APJ_1_t24_interface_backdate",
# ) # )
begin >> sftp_xx >> sftp_ppap >> ds_list_extractor >> csv_clean_syntax >> clean_csv >> pg_ddl_syntax >> pg_create_table >> ds_push_syntax >> sql_clean_syntax >> ds_csv_to_table >> ds_clean_data >> stop_task >> set_access_schemma >> set_access_all_table >> set_access_schemma_his >> set_access_all_table_his >> zip_today >> delete_before >> history_finish begin >> ds_list_extractor >> csv_clean_syntax >> clean_csv >> pg_ddl_syntax >> pg_create_table >> ds_push_syntax >> sql_clean_syntax >> ds_csv_to_table >> ds_clean_data >> stop_task >> set_access_schemma >> set_access_all_table >> set_access_schemma_his >> set_access_all_table_his >> zip_today >> delete_before >> history_finish
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