From 4e1f7c4721ec02a209be1ecd11c39301ac55c5cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=96=87=E8=89=B3?= Date: Sat, 8 Jan 2022 17:45:28 +0800 Subject: [PATCH] Update example_python_operator.py --- dags/example_python_operator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dags/example_python_operator.py b/dags/example_python_operator.py index 691259a..00ad132 100644 --- a/dags/example_python_operator.py +++ b/dags/example_python_operator.py @@ -2,8 +2,6 @@ import logging import shutil import time from datetime import datetime -from sklearn import linear_model - from airflow import DAG from airflow.decorators import task @@ -19,6 +17,7 @@ with 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 """Print the Airflow context and ds variable from the context.""" print(ds) return 'Whatever you return gets printed in the logs'