diff --git a/cosmos/profiles/athena/access_key.py b/cosmos/profiles/athena/access_key.py index 5aed255ce..b81c712de 100644 --- a/cosmos/profiles/athena/access_key.py +++ b/cosmos/profiles/athena/access_key.py @@ -9,7 +9,7 @@ class AthenaAccessKeyProfileMapping(BaseProfileMapping): """ Maps Airflow AWS connections to a dbt Athena profile using an access key id and secret access key. - + https://docs.getdbt.com/docs/core/connect-data-platform/athena-setup https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/connections/aws.html """ diff --git a/tests/profiles/athena/test_athena_access_key.py b/tests/profiles/athena/test_athena_access_key.py index d6ee2b896..2063ef6ed 100644 --- a/tests/profiles/athena/test_athena_access_key.py +++ b/tests/profiles/athena/test_athena_access_key.py @@ -27,12 +27,13 @@ def mock_athena_conn(): # type: ignore "s3_staging_dir": "s3://my_bucket/dbt/", "schema": "my_schema", } - ) + ), ) with patch("airflow.hooks.base.BaseHook.get_connection", return_value=conn): yield conn + def test_athena_connection_claiming() -> None: """ Tests that the Athena profile mapping claims the correct connection type. @@ -57,7 +58,7 @@ def test_athena_connection_claiming() -> None: "s3_staging_dir": "s3://my_bucket/dbt/", "schema": "my_schema", } - ) + ), } # if we're missing any of the values, it shouldn't claim @@ -79,6 +80,7 @@ def test_athena_connection_claiming() -> None: profile_mapping = AthenaAccessKeyProfileMapping(conn, {}) assert profile_mapping.can_claim_connection() + def test_athena_profile_mapping_selected( mock_athena_conn: Connection, ) -> None: @@ -90,6 +92,7 @@ def test_athena_profile_mapping_selected( ) assert isinstance(profile_mapping, AthenaAccessKeyProfileMapping) + def test_athena_profile_args( mock_athena_conn: Connection, ) -> None: @@ -110,6 +113,7 @@ def test_athena_profile_args( "schema": mock_athena_conn.extra_dejson.get("schema"), } + def test_athena_profile_args_overrides( mock_athena_conn: Connection, ) -> None: @@ -135,6 +139,7 @@ def test_athena_profile_args_overrides( "schema": "my_custom_schema", } + def test_athena_profile_env_vars( mock_athena_conn: Connection, ) -> None: