diff --git a/cosmos/converter.py b/cosmos/converter.py index 1a6dd6f56..77e95c210 100644 --- a/cosmos/converter.py +++ b/cosmos/converter.py @@ -16,7 +16,7 @@ from cosmos import cache, settings from cosmos.airflow.graph import build_airflow_graph -from cosmos.config import ProjectConfig, ExecutionConfig, RenderConfig, ProfileConfig +from cosmos.config import ExecutionConfig, ProfileConfig, ProjectConfig, RenderConfig from cosmos.constants import ExecutionMode from cosmos.dbt.graph import DbtGraph from cosmos.dbt.selector import retrieve_by_label diff --git a/cosmos/operators/virtualenv.py b/cosmos/operators/virtualenv.py index 49af9c7c1..5ca408baf 100644 --- a/cosmos/operators/virtualenv.py +++ b/cosmos/operators/virtualenv.py @@ -1,14 +1,13 @@ from __future__ import annotations -from functools import cached_property import os -import psutil import time - +from functools import cached_property from pathlib import Path from tempfile import TemporaryDirectory from typing import TYPE_CHECKING, Any, Callable +import psutil from airflow.utils.python_virtualenv import prepare_virtualenv from cosmos.exceptions import CosmosValueError diff --git a/dev/dags/example_virtualenv.py b/dev/dags/example_virtualenv.py index d13cf5099..3f4be60d5 100644 --- a/dev/dags/example_virtualenv.py +++ b/dev/dags/example_virtualenv.py @@ -6,12 +6,11 @@ from datetime import datetime from pathlib import Path -from airflow.decorators import dag from airflow.configuration import get_airflow_home +from airflow.decorators import dag from airflow.operators.empty import EmptyOperator from cosmos import DbtTaskGroup, ExecutionConfig, ExecutionMode, ProfileConfig, ProjectConfig - from cosmos.profiles import PostgresUserPasswordProfileMapping DEFAULT_DBT_ROOT_PATH = Path(__file__).parent / "dbt" @@ -27,6 +26,7 @@ ), ) + # [START virtualenv_example] @dag( schedule_interval="@daily",