From 00e354cc273c53ab676f57e4c9042f1b1540df24 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 07:51:52 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cosmos/profiles/athena/access_key.py | 2 +- tests/profiles/athena/test_athena_access_key.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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: