Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Airflow
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Margrenzo Gunawan
Airflow
Commits
6743d708
Commit
6743d708
authored
Dec 30, 2023
by
Margrenzo Gunawan
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FDSSUPPORT
parent
795f9315
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
1_t24_fdssupport.py
1_t24_fdssupport.py
+7
-7
1_t24_interface_fdssupport.py
1_t24_interface_fdssupport.py
+10
-10
No files found.
1_t24_
EO
.py
→
1_t24_
fdssupport
.py
View file @
6743d708
...
...
@@ -136,7 +136,7 @@ def ds_csv_to_table(ti, copy_sql, file_id, **context):
"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
),
# schedule='0/30 * * * *',
schedule_interval
=
None
,
...
...
@@ -163,10 +163,10 @@ with DAG("APJ_1_T24_EO",
sftp_xx
=
BashOperator
(
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
}
/"""
,
)
#
sftp_xx = BashOperator(
#
task_id="sftp_xx",
# 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(
# task_id="ds_get_t24_extractor",
...
...
@@ -312,7 +312,7 @@ with DAG("APJ_1_T24_EO",
ds_nominatif
=
TriggerDagRunOperator
(
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",
# 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
1_t24_interface_
backdate
.py
→
1_t24_interface_
fdssupport
.py
View file @
6743d708
...
...
@@ -101,7 +101,7 @@ def sql_clean_syntax(ti):
def
stop_task
(
**
kwargs
):
return
True
with
DAG
(
"APJ_
1_t24_interface_backdat
e"
,
with
DAG
(
"APJ_
FDS_T24_Interfac
e"
,
start_date
=
datetime
(
2021
,
1
,
1
),
schedule_interval
=
None
,
catchup
=
False
,
...
...
@@ -114,15 +114,15 @@ with DAG("APJ_1_t24_interface_backdate",
}
)
sftp_xx
=
BashOperator
(
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
}
/"""
,
)
#
sftp_xx = BashOperator(
#
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}/""",
#
)
sftp_ppap
=
BashOperator
(
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
}
/"""
,
)
#
sftp_ppap = BashOperator(
#
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}/""",
#
)
# sftp_neraca = BashOperator(
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment