Update example_python_operator.py

This commit is contained in:
2022-01-08 18:00:09 +08:00
parent 4e1f7c4721
commit ada9f493ab
+1
View File
@@ -18,6 +18,7 @@ with DAG(
@task.virtualenv(task_id="virtualenv_python", requirements=["sklearn"], system_site_packages=False) @task.virtualenv(task_id="virtualenv_python", requirements=["sklearn"], system_site_packages=False)
def print_context(ds=None, **kwargs): def print_context(ds=None, **kwargs):
from sklearn import linear_model from sklearn import linear_model
import pandas as pd
"""Print the Airflow context and ds variable from the context.""" """Print the Airflow context and ds variable from the context."""
print(ds) print(ds)
return 'Whatever you return gets printed in the logs' return 'Whatever you return gets printed in the logs'