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
one_jh
airflow-test-jh
Commits
3f43cb8e
Commit
3f43cb8e
authored
May 11, 2022
by
one_jh
Browse files
Add new file
parent
e78b3ce9
Changes
1
Hide whitespace changes
Inline
Side-by-side
bash_operator.py
0 → 100644
View file @
3f43cb8e
from
airflow.operators.bash_operator
import
BashOperator
from
airflow.models
import
DAG
from
datetime
import
datetime
,
timedelta
args
=
{
'owner'
:
'airflow'
,
'start_date'
:
datetime
(
2018
,
11
,
1
)
}
dag
=
DAG
(
dag_id
=
'hello_airflow'
,
default_args
=
args
,
schedule_interval
=
'@once'
)
# Bash Operator
cmd
=
'echo "Hello, Airflow"'
BashOperator
(
task_id
=
't1'
,
bash_command
=
cmd
,
dag
=
dag
)
# echo """from airflow.operators.bash_operator import BashOperator
# from airflow.models import DAG
# from datetime import datetime, timedelta
# args = {
# 'owner': 'airflow',
# 'start_date': datetime(2018, 11, 1)
# }
# dag = DAG(
# dag_id='hello_airflow',
# default_args=args,
# schedule_interval='@once')
# # Bash Operator
# cmd = 'echo Hello, Airflow'
# BashOperator(task_id='t1', bash_command=cmd, dag=dag)
# """ >> bash_operator.py
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