Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
김진영
airflow-test
Commits
89803127
Commit
89803127
authored
May 20, 2022
by
김진영
Browse files
Update batch_test.py
parent
bfe0dfa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
batch_test.py
View file @
89803127
...
...
@@ -19,12 +19,22 @@ def fail_alert(context):
"sections": [
{
"facts":[
{"name":"TEST1", "value": "TEST1"}
{"name":"■ Execution Time", "value": "{exec_date}"},
{"name":"■ Task", "value": "{task}"},
{"name":"■ DAG", "value": "{dag}"},
{"name":"■ Log URL", "value": "{log_url}"},
{"name":"■ Reason", "value":"{reason}"}
]
}
]
}
"""
"""
.
format
(
exec_date
=
context
.
get
(
'execution_date'
),
task
=
context
.
get
(
'task_instance'
).
task_id
,
dag
=
context
.
get
(
'task_instance'
).
dag_id
,
log_url
=
context
.
get
(
'task_instance'
).
log_url
,
reason
=
context
.
get
(
'exception'
)
)
alert
=
BashOperator
(
task_id
=
'fail_alert'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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