-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9dc2c9c
commit 0ce662e
Showing
9 changed files
with
314 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
from datetime import datetime | ||
from pathlib import Path | ||
|
||
from cosmos import DbtDag, ExecutionConfig, ExecutionMode, ProfileConfig, ProjectConfig | ||
from cosmos.profiles import PostgresUserPasswordProfileMapping | ||
|
||
DEFAULT_DBT_ROOT_PATH = Path(__file__).parent / "dbt" | ||
DBT_ROOT_PATH = Path(os.getenv("DBT_ROOT_PATH", DEFAULT_DBT_ROOT_PATH)) | ||
|
||
profile_config = ProfileConfig( | ||
profile_name="default", | ||
target_name="dev", | ||
profile_mapping=PostgresUserPasswordProfileMapping( | ||
conn_id="example_conn", | ||
profile_args={"schema": "public"}, | ||
disable_event_tracking=True, | ||
), | ||
) | ||
|
||
simple_dag_async = DbtDag( | ||
# dbt/cosmos-specific parameters | ||
project_config=ProjectConfig( | ||
DBT_ROOT_PATH / "jaffle_shop", | ||
), | ||
profile_config=profile_config, | ||
execution_config=ExecutionConfig( | ||
execution_mode=ExecutionMode.AIRFLOW_ASYNC, | ||
), | ||
# normal dag parameters | ||
schedule_interval=None, | ||
start_date=datetime(2023, 1, 1), | ||
catchup=False, | ||
dag_id="simple_dag_async", | ||
tags=["simple"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
from cosmos.operators.airflow_async import ( | ||
DbtBuildAirflowAsyncOperator, | ||
DbtCompileAirflowAsyncOperator, | ||
DbtDocsAirflowAsyncOperator, | ||
DbtDocsAzureStorageAirflowAsyncOperator, | ||
DbtDocsGCSAirflowAsyncOperator, | ||
DbtDocsS3AirflowAsyncOperator, | ||
DbtLSAirflowAsyncOperator, | ||
DbtRunAirflowAsyncOperator, | ||
DbtRunOperationAirflowAsyncOperator, | ||
DbtSeedAirflowAsyncOperator, | ||
DbtSnapshotAirflowAsyncOperator, | ||
DbtSourceAirflowAsyncOperator, | ||
DbtTestAirflowAsyncOperator, | ||
) | ||
from cosmos.operators.local import ( | ||
DbtBuildLocalOperator, | ||
DbtCompileLocalOperator, | ||
DbtDocsAzureStorageLocalOperator, | ||
DbtDocsGCSLocalOperator, | ||
DbtDocsLocalOperator, | ||
DbtDocsS3LocalOperator, | ||
DbtLSLocalOperator, | ||
DbtRunLocalOperator, | ||
DbtRunOperationLocalOperator, | ||
DbtSeedLocalOperator, | ||
DbtSnapshotLocalOperator, | ||
DbtSourceLocalOperator, | ||
DbtTestLocalOperator, | ||
) | ||
|
||
|
||
def test_dbt_build_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtBuildAirflowAsyncOperator, DbtBuildLocalOperator) | ||
|
||
|
||
def test_dbt_ls_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtLSAirflowAsyncOperator, DbtLSLocalOperator) | ||
|
||
|
||
def test_dbt_seed_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtSeedAirflowAsyncOperator, DbtSeedLocalOperator) | ||
|
||
|
||
def test_dbt_snapshot_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtSnapshotAirflowAsyncOperator, DbtSnapshotLocalOperator) | ||
|
||
|
||
def test_dbt_source_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtSourceAirflowAsyncOperator, DbtSourceLocalOperator) | ||
|
||
|
||
def test_dbt_run_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtRunAirflowAsyncOperator, DbtRunLocalOperator) | ||
|
||
|
||
def test_dbt_test_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtTestAirflowAsyncOperator, DbtTestLocalOperator) | ||
|
||
|
||
def test_dbt_run_operation_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtRunOperationAirflowAsyncOperator, DbtRunOperationLocalOperator) | ||
|
||
|
||
def test_dbt_docs_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtDocsAirflowAsyncOperator, DbtDocsLocalOperator) | ||
|
||
|
||
def test_dbt_docs_s3_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtDocsS3AirflowAsyncOperator, DbtDocsS3LocalOperator) | ||
|
||
|
||
def test_dbt_docs_azure_storage_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtDocsAzureStorageAirflowAsyncOperator, DbtDocsAzureStorageLocalOperator) | ||
|
||
|
||
def test_dbt_docs_gcs_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtDocsGCSAirflowAsyncOperator, DbtDocsGCSLocalOperator) | ||
|
||
|
||
def test_dbt_compile_airflow_async_operator_inheritance(): | ||
assert issubclass(DbtCompileAirflowAsyncOperator, DbtCompileLocalOperator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.