From dfc8b951cfaa0f4282012cb073c2a03f903d839c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:33:45 -0600 Subject: [PATCH] chore: pre-commit autoupdate (#240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.6 → v0.6.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.6...v0.6.1) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- target_snowflake/connector.py | 4 ++-- tests/test_target_snowflake.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be39498..97f1970 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: - id: check-github-workflows - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.6 + rev: v0.6.1 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/target_snowflake/connector.py b/target_snowflake/connector.py index b5d612a..4b7df6e 100644 --- a/target_snowflake/connector.py +++ b/target_snowflake/connector.py @@ -406,7 +406,7 @@ def _get_merge_from_stage_statement( # noqa: ANN202 dedup = f"QUALIFY ROW_NUMBER() OVER (PARTITION BY {dedup_cols} ORDER BY SEQ8() DESC) = 1" return ( text( - f"merge into {full_table_name} d using " # noqa: ISC003 + f"merge into {full_table_name} d using " # noqa: ISC003, S608 + f"(select {json_casting_selects} from '@~/target-snowflake/{sync_id}'" # noqa: S608 + f"(file_format => {file_format}) {dedup}) s " + f"on {join_expr} " @@ -431,7 +431,7 @@ def _get_copy_statement(self, full_table_name, schema, sync_id, file_format): # ) return ( text( - f"copy into {full_table_name} {col_alias_selects} from " # noqa: ISC003 + f"copy into {full_table_name} {col_alias_selects} from " # noqa: ISC003, S608 + f"(select {json_casting_selects} from " # noqa: S608 + f"'@~/target-snowflake/{sync_id}')" + f"file_format = (format_name='{file_format}')", diff --git a/tests/test_target_snowflake.py b/tests/test_target_snowflake.py index 8a20d9a..ac9e9ac 100644 --- a/tests/test_target_snowflake.py +++ b/tests/test_target_snowflake.py @@ -29,14 +29,14 @@ class BaseSnowflakeTargetTests: """Base class for Snowflake target tests.""" - @pytest.fixture() + @pytest.fixture def connection(self, runner): return runner.singer_class.default_sink_class.connector_class( runner.config, ).connection - @pytest.fixture() - def resource(self, runner, connection): # noqa: PT004 + @pytest.fixture + def resource(self, runner, connection): """Generic external resource. This fixture is useful for setup and teardown of external resources,