From 669e2c6acb22f47bf7c16831dff2bfd4822a44f7 Mon Sep 17 00:00:00 2001 From: Jian Shen Date: Mon, 27 Jun 2022 18:45:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=AE=9A=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/example_python_operator.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/dags/example_python_operator.py b/dags/example_python_operator.py index 34c23ec..b68252c 100644 --- a/dags/example_python_operator.py +++ b/dags/example_python_operator.py @@ -9,18 +9,9 @@ log = logging.getLogger(__name__) with DAG( dag_id='example_python_operator', - schedule_interval=None, + schedule_interval="*/1 * * * *", start_date=datetime(2021, 1, 1), catchup=False, tags=['example'], ) as dag: - # [START howto_operator_python] - @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() \ No newline at end of file + print('success') \ No newline at end of file