impala-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From taras...@apache.org
Subject incubator-impala git commit: IMPALA-5044: test infra: remove backports.tempfile
Date Thu, 09 Mar 2017 02:46:33 GMT
Repository: incubator-impala
Updated Branches:
  refs/heads/master 18927ac85 -> cc8a11983


IMPALA-5044: test infra: remove backports.tempfile

backports.tempfile is not compatible with Python 2.6, so if Python 2.6
is the Python used for end-to-end tests, this test unconditionally
fails.  Moreover, Py.test provides a builtin tmpdir fixture with
equivalent functionality. Remove the requirement and port tests using
backports.tempfile.TemporaryDirectory to use tmpdir.

Change-Id: I887b62eb1b3425fc8fd62562e28f0c17cb261f6d
Reviewed-on: http://gerrit.cloudera.org:8080/6316
Reviewed-by: Michael Brown <mikeb@cloudera.com>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/cc8a1198
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/cc8a1198
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/cc8a1198

Branch: refs/heads/master
Commit: cc8a11983945fe3409f4693431774733923a0222
Parents: 18927ac
Author: Michael Brown <mikeb@cloudera.com>
Authored: Wed Mar 8 09:02:23 2017 -0800
Committer: Impala Public Jenkins <impala-public-jenkins@gerrit.cloudera.org>
Committed: Thu Mar 9 01:57:37 2017 +0000

----------------------------------------------------------------------
 infra/python/deps/requirements.txt      |  1 -
 tests/query_test/test_insert_parquet.py | 16 +++++++---------
 2 files changed, 7 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cc8a1198/infra/python/deps/requirements.txt
----------------------------------------------------------------------
diff --git a/infra/python/deps/requirements.txt b/infra/python/deps/requirements.txt
index c068c83..7d9d484 100644
--- a/infra/python/deps/requirements.txt
+++ b/infra/python/deps/requirements.txt
@@ -23,7 +23,6 @@
 # multiple times (though maybe they could be).
 
 allpairs == 2.0.1
-backports.tempfile == 1.0rc1
 boto3 == 1.2.3
   simplejson == 3.3.0 # For python version 2.6
   botocore == 1.3.30

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/cc8a1198/tests/query_test/test_insert_parquet.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_insert_parquet.py b/tests/query_test/test_insert_parquet.py
index cca5827..1472bb1 100644
--- a/tests/query_test/test_insert_parquet.py
+++ b/tests/query_test/test_insert_parquet.py
@@ -23,7 +23,6 @@ from collections import namedtuple
 from shutil import rmtree
 from subprocess import check_call
 from tempfile import mkdtemp as make_tmp_dir
-from backports.tempfile import TemporaryDirectory
 from parquet.ttypes import SortingColumn
 
 from tests.common.environ import impalad_basedir
@@ -215,7 +214,7 @@ class TestHdfsParquetTableWriter(ImpalaTestSuite):
       self.execute_query("drop table %s" % qualified_table_name)
       rmtree(tmp_dir)
 
-  def test_sorting_columns(self, vector, unique_database):
+  def test_sorting_columns(self, vector, unique_database, tmpdir):
     """Tests that RowGroup::sorting_columns gets populated when specifying a sortby()
     insert hint."""
     source_table = "functional_parquet.alltypessmall"
@@ -237,14 +236,13 @@ class TestHdfsParquetTableWriter(ImpalaTestSuite):
 
     # Download hdfs files and extract rowgroup metadata
     row_groups = []
-    with TemporaryDirectory() as tmp_dir:
-      check_call(['hdfs', 'dfs', '-get', hdfs_path, tmp_dir])
+    check_call(['hdfs', 'dfs', '-get', hdfs_path, tmpdir.strpath])
 
-      for root, subdirs, files in os.walk(tmp_dir):
-        for f in files:
-          parquet_file = os.path.join(root, str(f))
-          file_meta_data = get_parquet_metadata(parquet_file)
-          row_groups.extend(file_meta_data.row_groups)
+    for root, subdirs, files in os.walk(tmpdir.strpath):
+      for f in files:
+        parquet_file = os.path.join(root, str(f))
+        file_meta_data = get_parquet_metadata(parquet_file)
+        row_groups.extend(file_meta_data.row_groups)
 
     # Verify that the files have the sorted_columns set
     expected = [SortingColumn(4, False, False), SortingColumn(0, False, False)]


Mime
View raw message