From 9a5a2622dd67d6510ac70a18a8ee216ce5a3b5b2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 11:08:17 -0600 Subject: [PATCH] chore: pre-commit autoupdate (#142) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.7 → v0.1.8](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.7...v0.1.8) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- target_snowflake/connector.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 81cce64..2954a9a 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.1.7 + rev: v0.1.8 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/target_snowflake/connector.py b/target_snowflake/connector.py index 88d5b2f..6961fe2 100644 --- a/target_snowflake/connector.py +++ b/target_snowflake/connector.py @@ -382,7 +382,7 @@ def _get_merge_from_stage_statement( # noqa: ANN202, PLR0913 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: S608, ISC003 + f"merge into {full_table_name} d using " # noqa: ISC003 + f"(select {json_casting_selects} from '@~/target-snowflake/{sync_id}'" # noqa: S608 + f"(file_format => {file_format}) {dedup}) s " + f"on {join_expr} " @@ -407,7 +407,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: S608, ISC003 + f"copy into {full_table_name} {col_alias_selects} from " # noqa: ISC003 + f"(select {json_casting_selects} from " # noqa: S608 + f"'@~/target-snowflake/{sync_id}')" + f"file_format = (format_name='{file_format}')",