diff --git a/airbyte-integrations/bases/base-normalization/Dockerfile b/airbyte-integrations/bases/base-normalization/Dockerfile index d7d9c552ced7..09d29f56324b 100644 --- a/airbyte-integrations/bases/base-normalization/Dockerfile +++ b/airbyte-integrations/bases/base-normalization/Dockerfile @@ -28,5 +28,5 @@ WORKDIR /airbyte ENV AIRBYTE_ENTRYPOINT "/airbyte/entrypoint.sh" ENTRYPOINT ["/airbyte/entrypoint.sh"] -LABEL io.airbyte.version=0.2.9 +LABEL io.airbyte.version=0.2.10 LABEL io.airbyte.name=airbyte/normalization \ No newline at end of file diff --git a/airbyte-integrations/bases/base-normalization/normalization/transform_config/transform.py b/airbyte-integrations/bases/base-normalization/normalization/transform_config/transform.py index 42e3838b8d7c..4971fb9c706a 100644 --- a/airbyte-integrations/bases/base-normalization/normalization/transform_config/transform.py +++ b/airbyte-integrations/bases/base-normalization/normalization/transform_config/transform.py @@ -219,6 +219,12 @@ def transform_snowflake(config: Dict[str, Any]): dbt_config["oauth_client_id"] = credentials["client_id"] dbt_config["oauth_client_secret"] = credentials["client_secret"] dbt_config["token"] = credentials["refresh_token"] + elif credentials.get("private_key"): + with open("private_key_path.txt", "w") as f: + f.write(credentials["private_key"]) + dbt_config["private_key_path"] = "private_key_path.txt" + if credentials.get("private_key_password"): + dbt_config["private_key_passphrase"] = credentials["private_key_password"] elif credentials.get("password"): dbt_config["password"] = credentials["password"] else: diff --git a/airbyte-integrations/bases/base-normalization/unit_tests/test_transform_config.py b/airbyte-integrations/bases/base-normalization/unit_tests/test_transform_config.py index 92c3c2950435..36809f53eb19 100644 --- a/airbyte-integrations/bases/base-normalization/unit_tests/test_transform_config.py +++ b/airbyte-integrations/bases/base-normalization/unit_tests/test_transform_config.py @@ -344,6 +344,44 @@ def test_transform_snowflake_oauth(self): assert expected == actual assert extract_schema(actual) == "AIRBYTE_SCHEMA" + def test_transform_snowflake_key_pair(self): + + input = { + "host": "http://123abc.us-east-7.aws.snowflakecomputing.com", + "role": "AIRBYTE_ROLE", + "warehouse": "AIRBYTE_WAREHOUSE", + "database": "AIRBYTE_DATABASE", + "schema": "AIRBYTE_SCHEMA", + "username": "AIRBYTE_USER", + "credentials": { + "private_key": "AIRBYTE_PRIVATE_KEY", + "private_key_password": "AIRBYTE_PRIVATE_KEY_PASSWORD", + }, + } + + actual = TransformConfig().transform_snowflake(input) + expected = { + "account": "123abc.us-east-7.aws", + "client_session_keep_alive": False, + "database": "AIRBYTE_DATABASE", + "query_tag": "normalization", + "role": "AIRBYTE_ROLE", + "schema": "AIRBYTE_SCHEMA", + "threads": 5, + "retry_all": True, + "retry_on_database_errors": True, + "connect_retries": 3, + "connect_timeout": 15, + "type": "snowflake", + "user": "AIRBYTE_USER", + "warehouse": "AIRBYTE_WAREHOUSE", + "private_key_path": "private_key_path.txt", + "private_key_passphrase": "AIRBYTE_PRIVATE_KEY_PASSWORD", + } + + assert expected == actual + assert extract_schema(actual) == "AIRBYTE_SCHEMA" + def test_transform_mysql(self): input = { "type": "mysql5", diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationRunnerFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationRunnerFactory.java index 1bb56b3a28ef..5f885878e132 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationRunnerFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/normalization/NormalizationRunnerFactory.java @@ -14,7 +14,7 @@ public class NormalizationRunnerFactory { public static final String BASE_NORMALIZATION_IMAGE_NAME = "airbyte/normalization"; - public static final String NORMALIZATION_VERSION = "0.2.9"; + public static final String NORMALIZATION_VERSION = "0.2.10"; static final Map> NORMALIZATION_MAPPING = ImmutableMap.>builder() diff --git a/docs/understanding-airbyte/basic-normalization.md b/docs/understanding-airbyte/basic-normalization.md index 817f94be688b..f372182cce83 100644 --- a/docs/understanding-airbyte/basic-normalization.md +++ b/docs/understanding-airbyte/basic-normalization.md @@ -353,7 +353,8 @@ Therefore, in order to "upgrade" to the desired normalization version, you need | Airbyte Version | Normalization Version | Date | Pull Request | Subject | |:----------------| :--- | :--- | :--- | :--- | -| | 0.2.9 | 2022-07-06 | [\#14485](https://github.com/airbytehq/airbyte/pull/14485/) | BigQuery partition pruning otimization | +| | 0.2.10 | 2022-07-18 | [\#14792](https://github.com/airbytehq/airbyte/pull/14792) | Add support for key pair auth for snowflake | +| | 0.2.9 | 2022-07-06 | [\#14485](https://github.com/airbytehq/airbyte/pull/14485) | BigQuery partition pruning otimization | | | 0.2.8 | 2022-07-13 | [\#14522](https://github.com/airbytehq/airbyte/pull/14522) | BigQuery replaces `NULL` array entries with the string value `"NULL"` | | | 0.2.7 | 2022-07-05 | [\#11694](https://github.com/airbytehq/airbyte/pull/11694) | Do not return NULL for MySQL column values > 512 chars | | | 0.2.6 | 2022-06-16 | [\#13894](https://github.com/airbytehq/airbyte/pull/13894) | Fix incorrect jinja2 macro `json_extract_array` call |