You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2023/02/10 21:00:11 UTC

[airflow] branch main updated: Fix missing parens for files parameter (#29437)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 0fd4fc7f35 Fix missing parens for files parameter (#29437)
0fd4fc7f35 is described below

commit 0fd4fc7f35f0e12bef2c9615acf9651e9f2cec72
Author: Bryan Nix <bn...@users.noreply.github.com>
AuthorDate: Fri Feb 10 14:00:01 2023 -0700

    Fix missing parens for files parameter (#29437)
    
    File list must be enclosed with parentheses
---
 airflow/providers/snowflake/transfers/copy_into_snowflake.py    | 2 +-
 tests/providers/snowflake/transfers/test_copy_into_snowflake.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/providers/snowflake/transfers/copy_into_snowflake.py b/airflow/providers/snowflake/transfers/copy_into_snowflake.py
index 736b53e1c5..6c164244a7 100644
--- a/airflow/providers/snowflake/transfers/copy_into_snowflake.py
+++ b/airflow/providers/snowflake/transfers/copy_into_snowflake.py
@@ -132,7 +132,7 @@ class CopyFromExternalStageToSnowflakeOperator(BaseOperator):
         sql = f"""
         COPY INTO {into}
              FROM  @{self.stage}/{self.prefix or ""}
-        {"FILES=" + ",".join(map(enclose_param ,self.files)) if self.files else ""}
+        {"FILES=(" + ",".join(map(enclose_param, self.files)) + ")" if self.files else ""}
         {"PATTERN=" + enclose_param(self.pattern) if self.pattern else ""}
         FILE_FORMAT={self.file_format}
         {self.copy_options or ""}
diff --git a/tests/providers/snowflake/transfers/test_copy_into_snowflake.py b/tests/providers/snowflake/transfers/test_copy_into_snowflake.py
index f0e7a61fd5..76268d077d 100644
--- a/tests/providers/snowflake/transfers/test_copy_into_snowflake.py
+++ b/tests/providers/snowflake/transfers/test_copy_into_snowflake.py
@@ -55,7 +55,7 @@ class TestCopyFromExternalStageToSnowflake:
         sql = """
         COPY INTO schema.table(col1, col2)
              FROM  @stage/prefix
-        FILES='file1.csv','file2.csv'
+        FILES=('file1.csv','file2.csv')
         PATTERN='*.csv'
         FILE_FORMAT=CSV
         copy_options