测试定时
This commit is contained in:
@@ -9,18 +9,9 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
with DAG(
|
with DAG(
|
||||||
dag_id='example_python_operator',
|
dag_id='example_python_operator',
|
||||||
schedule_interval=None,
|
schedule_interval="*/1 * * * *",
|
||||||
start_date=datetime(2021, 1, 1),
|
start_date=datetime(2021, 1, 1),
|
||||||
catchup=False,
|
catchup=False,
|
||||||
tags=['example'],
|
tags=['example'],
|
||||||
) as dag:
|
) as dag:
|
||||||
# [START howto_operator_python]
|
print('success')
|
||||||
@task.virtualenv(task_id="virtualenv_python", requirements=["sklearn"], system_site_packages=False)
|
|
||||||
def print_context(ds=None, **kwargs):
|
|
||||||
from sklearn import linear_model
|
|
||||||
import pandas as pd
|
|
||||||
"""Print the Airflow context and ds variable from the context."""
|
|
||||||
print(ds)
|
|
||||||
return 'Whatever you return gets printed in the logs'
|
|
||||||
|
|
||||||
run_this = print_context()
|
|
||||||
Reference in New Issue
Block a user