You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by se...@apache.org on 2020/07/09 18:25:52 UTC

[incubator-superset] branch master updated: fix(csv upload): hive params typo (#10273)

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

serena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new c67b1ab  fix(csv upload): hive params typo (#10273)
c67b1ab is described below

commit c67b1abfd8bd79aadb529cd58530f1e11eb12a65
Author: serenajiang <se...@airbnb.com>
AuthorDate: Thu Jul 9 11:25:35 2020 -0700

    fix(csv upload): hive params typo (#10273)
    
    * fix(csv upload): fix :params typo
    
    * fix tests
---
 superset/db_engine_specs/hive.py    | 4 ++--
 tests/db_engine_specs/hive_tests.py | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/superset/db_engine_specs/hive.py b/superset/db_engine_specs/hive.py
index bb2c43c..4cafaaf 100644
--- a/superset/db_engine_specs/hive.py
+++ b/superset/db_engine_specs/hive.py
@@ -140,11 +140,11 @@ class HiveEngineSpec(PrestoEngineSpec):
         }
         if header_line_count is not None and header_line_count >= 0:
             header_line_count += 1
-            tblproperties.append("'skip.header.line.count'=':header_line_count'")
+            tblproperties.append("'skip.header.line.count'=:header_line_count")
             params["header_line_count"] = str(header_line_count)
         if null_values:
             # hive only supports 1 value for the null format
-            tblproperties.append("'serialization.null.format'=':null_value'")
+            tblproperties.append("'serialization.null.format'=:null_value")
             params["null_value"] = null_values[0]
 
         if tblproperties:
diff --git a/tests/db_engine_specs/hive_tests.py b/tests/db_engine_specs/hive_tests.py
index b272bbb..73004a9 100644
--- a/tests/db_engine_specs/hive_tests.py
+++ b/tests/db_engine_specs/hive_tests.py
@@ -181,7 +181,7 @@ def test_get_create_table_stmt() -> None:
         """CREATE TABLE employee ( eid int, name String, salary String, destination String )
                 ROW FORMAT DELIMITED FIELDS TERMINATED BY :delim
                 STORED AS TEXTFILE LOCATION :location
-                tblproperties ('skip.header.line.count'=':header_line_count', 'serialization.null.format'=':null_value')""",
+                tblproperties ('skip.header.line.count'=:header_line_count, 'serialization.null.format'=:null_value)""",
         {
             "delim": ",",
             "location": "s3a://directory/table",
@@ -195,7 +195,7 @@ def test_get_create_table_stmt() -> None:
         """CREATE TABLE employee ( eid int, name String, salary String, destination String )
                 ROW FORMAT DELIMITED FIELDS TERMINATED BY :delim
                 STORED AS TEXTFILE LOCATION :location
-                tblproperties ('skip.header.line.count'=':header_line_count', 'serialization.null.format'=':null_value')""",
+                tblproperties ('skip.header.line.count'=:header_line_count, 'serialization.null.format'=:null_value)""",
         {
             "delim": ",",
             "location": "s3a://directory/table",
@@ -209,7 +209,7 @@ def test_get_create_table_stmt() -> None:
         """CREATE TABLE employee ( eid int, name String, salary String, destination String )
                 ROW FORMAT DELIMITED FIELDS TERMINATED BY :delim
                 STORED AS TEXTFILE LOCATION :location
-                tblproperties ('skip.header.line.count'=':header_line_count', 'serialization.null.format'=':null_value')""",
+                tblproperties ('skip.header.line.count'=:header_line_count, 'serialization.null.format'=:null_value)""",
         {
             "delim": ",",
             "location": "s3a://directory/table",
@@ -231,6 +231,6 @@ def test_get_create_table_stmt() -> None:
         """CREATE TABLE employee ( eid int, name String, salary String, destination String )
                 ROW FORMAT DELIMITED FIELDS TERMINATED BY :delim
                 STORED AS TEXTFILE LOCATION :location
-                tblproperties ('skip.header.line.count'=':header_line_count')""",
+                tblproperties ('skip.header.line.count'=:header_line_count)""",
         {"delim": ",", "location": "s3a://directory/table", "header_line_count": "101"},
     )