impala-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From taras...@apache.org
Subject [1/2] incubator-impala git commit: Clean up Python test import statements
Date Fri, 15 Jul 2016 23:26:28 GMT
Repository: incubator-impala
Updated Branches:
  refs/heads/master 45740c8bc -> 609b80410


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_query_mem_limit.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_query_mem_limit.py b/tests/query_test/test_query_mem_limit.py
index 41df1f3..b0d2a73 100644
--- a/tests/query_test/test_query_mem_limit.py
+++ b/tests/query_test/test_query_mem_limit.py
@@ -15,12 +15,15 @@
 # Targeted tests to validate per-query memory limit.
 
 import pytest
-import sys
 import re
+import sys
 from copy import copy
+
 from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
-from tests.common.test_vector import *
-from tests.common.impala_test_suite import *
+from tests.common.impala_test_suite import ImpalaTestSuite
+from tests.common.test_dimensions import (
+    TestDimension,
+    create_uncompressed_text_dimension)
 
 
 class TestQueryMemLimit(ImpalaTestSuite):

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_query_opts.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_query_opts.py b/tests/query_test/test_query_opts.py
index 6b6cd24..8a7c1dd 100644
--- a/tests/query_test/test_query_opts.py
+++ b/tests/query_test/test_query_opts.py
@@ -17,14 +17,11 @@
 #       to make it easier to handle startup failures (right now it waits 60sec to
 #       timeout).
 
-from ImpalaService import ImpalaHiveServer2Service
 from TCLIService import TCLIService
 
-from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
-from tests.common.custom_cluster_test_suite import CustomClusterTestSuite
 from tests.common.impala_test_suite import ImpalaTestSuite
 from tests.common.test_dimensions import create_exec_option_dimension
-from tests.hs2.hs2_test_suite import HS2TestSuite, needs_session, operation_id_to_query_id
+from tests.hs2.hs2_test_suite import HS2TestSuite, needs_session
 
 class TestQueryOptions(ImpalaTestSuite):
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_runtime_filters.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_runtime_filters.py b/tests/query_test/test_runtime_filters.py
index 9efafe1..1ef1a62 100644
--- a/tests/query_test/test_runtime_filters.py
+++ b/tests/query_test/test_runtime_filters.py
@@ -13,10 +13,10 @@
 # limitations under the License.
 #
 
+import pytest
 import time
 
-from tests.common.test_vector import *
-from tests.common.impala_test_suite import *
+from tests.common.impala_test_suite import ImpalaTestSuite
 from tests.common.skip import SkipIfLocal, SkipIfOldAggsJoins
 
 @SkipIfLocal.multiple_impalad

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_scanners.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_scanners.py b/tests/query_test/test_scanners.py
index 878c934..8e710b9 100644
--- a/tests/query_test/test_scanners.py
+++ b/tests/query_test/test_scanners.py
@@ -6,23 +6,29 @@
 # tests can run with the normal exploration strategy and the overall test runtime doesn't
 # explode.
 
-import logging
+import os
 import pytest
 import random
+import re
 import tempfile
 from copy import deepcopy
+from parquet.ttypes import ConvertedType
 from subprocess import call, check_call
 
 from testdata.common import widetable
-from tests.common.test_vector import *
-from tests.common.impala_test_suite import *
-from tests.util.test_file_parser import *
+from tests.common.impala_test_suite import ImpalaTestSuite, LOG
+from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfOldAggsJoins, SkipIfLocal
+from tests.common.test_dimensions import create_single_exec_option_dimension
+from tests.common.test_result_verifier import (
+    parse_column_types,
+    parse_column_labels,
+    QueryTestResult,
+    parse_result_rows)
+from tests.common.test_vector import TestDimension
 from tests.util.filesystem_utils import WAREHOUSE, get_fs_path
 from tests.util.get_parquet_metadata import get_parquet_metadata
-from tests.common.test_dimensions import create_single_exec_option_dimension
-from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfOldAggsJoins, SkipIfLocal
+from tests.util.test_file_parser import QueryTestSectionReader
 
-from parquet.ttypes import ConvertedType
 
 class TestScannersAllTableFormats(ImpalaTestSuite):
   BATCH_SIZES = [0, 1, 16]

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_sort.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_sort.py b/tests/query_test/test_sort.py
index a83417e..2bf2036 100644
--- a/tests/query_test/test_sort.py
+++ b/tests/query_test/test_sort.py
@@ -12,14 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import pytest
-import sys
-import re
-import random
-from copy import copy
-from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
-from tests.common.test_vector import *
-from tests.common.impala_test_suite import *
+from tests.common.impala_test_suite import ImpalaTestSuite
 
 def transpose_results(result):
   """Given a query result (list of strings, each string represents a row), return a list

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_timezones.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_timezones.py b/tests/query_test/test_timezones.py
index ff9fac7..71b18ef 100644
--- a/tests/query_test/test_timezones.py
+++ b/tests/query_test/test_timezones.py
@@ -6,12 +6,7 @@
 # tests can run with the normal exploration strategy and the overall test runtime doesn't
 # explode.
 
-import logging
-import pytest
-
-from tests.common.test_vector import *
-from tests.common.impala_test_suite import *
-from tests.common.test_dimensions import create_single_exec_option_dimension
+from tests.common.impala_test_suite import ImpalaTestSuite
 
 class TestTimeZones(ImpalaTestSuite):
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_tpcds_queries.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_tpcds_queries.py b/tests/query_test/test_tpcds_queries.py
index 1ade7ed..bc05250 100644
--- a/tests/query_test/test_tpcds_queries.py
+++ b/tests/query_test/test_tpcds_queries.py
@@ -1,10 +1,12 @@
 # Copyright (c) 2012 Cloudera, Inc. All rights reserved.
 # Functional tests running the TPC-DS workload
 #
-import logging
 import pytest
-from tests.common.test_vector import *
-from tests.common.impala_test_suite import *
+
+from tests.common.impala_test_suite import ImpalaTestSuite
+from tests.common.test_dimensions import (
+    create_single_exec_option_dimension,
+    is_supported_insert_format)
 
 class TestTpcdsQuery(ImpalaTestSuite):
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_tpch_nested_queries.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_tpch_nested_queries.py b/tests/query_test/test_tpch_nested_queries.py
index 3d08983..6983b41 100644
--- a/tests/query_test/test_tpch_nested_queries.py
+++ b/tests/query_test/test_tpch_nested_queries.py
@@ -1,11 +1,9 @@
 # Copyright (c) 2015 Cloudera, Inc. All rights reserved.
 # Functional tests running the TPCH workload.
-#
-import logging
-import pytest
-from tests.common.impala_test_suite import ImpalaTestSuite,\
-    create_single_exec_option_dimension
+
+from tests.common.impala_test_suite import ImpalaTestSuite
 from tests.common.skip import SkipIfOldAggsJoins
+from tests.common.test_dimensions import create_single_exec_option_dimension
 
 @SkipIfOldAggsJoins.nested_types
 class TestTpchNestedQuery(ImpalaTestSuite):

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_tpch_queries.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_tpch_queries.py b/tests/query_test/test_tpch_queries.py
index 794c9a0..3d71925 100644
--- a/tests/query_test/test_tpch_queries.py
+++ b/tests/query_test/test_tpch_queries.py
@@ -1,10 +1,8 @@
 # Copyright (c) 2012 Cloudera, Inc. All rights reserved.
 # Functional tests running the TPCH workload.
-#
-import logging
-import pytest
-from tests.common.test_vector import *
-from tests.common.impala_test_suite import *
+
+from tests.common.impala_test_suite import ImpalaTestSuite
+from tests.common.test_dimensions import create_single_exec_option_dimension
 
 class TestTpchQuery(ImpalaTestSuite):
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/query_test/test_udfs.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_udfs.py b/tests/query_test/test_udfs.py
index 4f17f5b..e64a9e0 100644
--- a/tests/query_test/test_udfs.py
+++ b/tests/query_test/test_udfs.py
@@ -1,15 +1,18 @@
 # Copyright (c) 2012 Cloudera, Inc. All rights reserved.
 
 import os
+import pytest
+from subprocess import check_call
+
 from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
-from tests.common.test_vector import *
-from tests.common.impala_test_suite import *
 from tests.common.impala_cluster import ImpalaCluster
+from tests.common.impala_test_suite import ImpalaTestSuite
 from tests.common.skip import SkipIfLocal
-from tests.common.skip import SkipIfS3
+from tests.common.test_dimensions import (
+    create_single_exec_option_dimension,
+    create_uncompressed_text_dimension)
 from tests.util.calculation_util import get_random_id
 from tests.util.filesystem_utils import get_fs_path, IS_S3
-from subprocess import check_call
 
 class TestUdfs(ImpalaTestSuite):
   @classmethod

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/shell/test_shell_commandline.py
----------------------------------------------------------------------
diff --git a/tests/shell/test_shell_commandline.py b/tests/shell/test_shell_commandline.py
index fa4fc44..cd50ec6 100644
--- a/tests/shell/test_shell_commandline.py
+++ b/tests/shell/test_shell_commandline.py
@@ -16,16 +16,14 @@
 import os
 import pytest
 import re
-import shlex
 import signal
 
-from subprocess import Popen, PIPE, call
+from subprocess import call
 from tests.common.impala_service import ImpaladService
-from time import sleep
 from tests.common.impala_test_suite import ImpalaTestSuite
-from tests.common.patterns import is_valid_impala_identifier
-from util import assert_var_substitution, run_impala_shell_cmd, ImpalaShell
+from time import sleep
 from util import IMPALAD, SHELL_CMD
+from util import assert_var_substitution, run_impala_shell_cmd, ImpalaShell
 
 DEFAULT_QUERY = 'select 1'
 QUERY_FILE_PATH = os.path.join(os.environ['IMPALA_HOME'], 'tests', 'shell')

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/shell/test_shell_interactive.py
----------------------------------------------------------------------
diff --git a/tests/shell/test_shell_interactive.py b/tests/shell/test_shell_interactive.py
index f03c58f..1b2d554 100755
--- a/tests/shell/test_shell_interactive.py
+++ b/tests/shell/test_shell_interactive.py
@@ -14,20 +14,17 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 import os
 import pexpect
 import pytest
-import re
 import shutil
-import socket
 import signal
+import socket
 import sys
+from time import sleep
 
-from subprocess import Popen, PIPE
 from tests.common.impala_service import ImpaladService
 from tests.common.skip import SkipIfLocal
-from time import sleep
 from util import assert_var_substitution, ImpalaShell
 
 SHELL_CMD = "%s/bin/impala-shell.sh" % os.environ['IMPALA_HOME']
@@ -70,7 +67,6 @@ class TestImpalaShellInteractive(object):
   @pytest.mark.execute_serially
   def test_compute_stats_with_live_progress_options(self):
     """Test that setting LIVE_PROGRESS options won't cause COMPUTE STATS query fail"""
-    impalad = ImpaladService(socket.getfqdn())
     p = ImpalaShell()
     p.send_cmd("set live_progress=True")
     p.send_cmd("set live_summary=True")

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/statestore/test_statestore.py
----------------------------------------------------------------------
diff --git a/tests/statestore/test_statestore.py b/tests/statestore/test_statestore.py
index 49a8bc1..607d873 100644
--- a/tests/statestore/test_statestore.py
+++ b/tests/statestore/test_statestore.py
@@ -12,22 +12,18 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import pytest
-import os
-import time
-import threading
+import json
 import socket
-import uuid
+import threading
+import time
 import urllib2
-import json
-
-from tests.common.environ import specific_build_type_timeout
+import uuid
 
-from thrift.transport import TSocket
-from thrift.transport import TTransport
+from Types.ttypes import TNetworkAddress
 from thrift.protocol import TBinaryProtocol
 from thrift.server.TServer import TServer
-from Types.ttypes import TNetworkAddress
+from thrift.transport import TSocket
+from thrift.transport import TTransport
 
 import StatestoreService.StatestoreSubscriber as Subscriber
 import StatestoreService.StatestoreService as Statestore
@@ -36,6 +32,8 @@ from StatestoreService.StatestoreSubscriber import TTopicRegistration
 from ErrorCodes.ttypes import TErrorCode
 from Status.ttypes import TStatus
 
+from tests.common.environ import specific_build_type_timeout
+
 # Tests for the statestore. The StatestoreSubscriber class is a skeleton implementation of
 # a Python-based statestore subscriber with additional hooks to allow testing. Each
 # StatestoreSubscriber runs its own server so that the statestore may contact it.

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/stress/test_ddl_stress.py
----------------------------------------------------------------------
diff --git a/tests/stress/test_ddl_stress.py b/tests/stress/test_ddl_stress.py
index 18e1216..6c2c18b 100644
--- a/tests/stress/test_ddl_stress.py
+++ b/tests/stress/test_ddl_stress.py
@@ -12,14 +12,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import os
 import pytest
-import re
 import uuid
-from subprocess import call
-from tests.common.test_vector import TestDimension
+
 from tests.common.impala_test_suite import ImpalaTestSuite
 from tests.common.skip import SkipIfS3, SkipIfIsilon, SkipIfLocal
+from tests.common.test_vector import TestDimension
 
 # Number of tables to create per thread
 NUM_TBLS_PER_THREAD = 10

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/stress/test_mini_stress.py
----------------------------------------------------------------------
diff --git a/tests/stress/test_mini_stress.py b/tests/stress/test_mini_stress.py
index fd287da..0adca42 100644
--- a/tests/stress/test_mini_stress.py
+++ b/tests/stress/test_mini_stress.py
@@ -1,13 +1,11 @@
 # Copyright (c) 2012 Cloudera, Inc. All rights reserved.
-#
-import os
+
 import pytest
 import re
-from time import sleep
+
 from tests.common.impala_cluster import ImpalaCluster
-from tests.common.test_vector import TestDimension
 from tests.common.impala_test_suite import ImpalaTestSuite
-from tests.util.test_file_parser import QueryTestSectionReader
+from tests.common.test_vector import TestDimension
 
 # Number of times to execute each query
 NUM_ITERATIONS = 5

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/unittests/test_file_parser.py
----------------------------------------------------------------------
diff --git a/tests/unittests/test_file_parser.py b/tests/unittests/test_file_parser.py
index cd2d0f3..b6f0860 100644
--- a/tests/unittests/test_file_parser.py
+++ b/tests/unittests/test_file_parser.py
@@ -1,10 +1,8 @@
 # Copyright (c) 2012 Cloudera, Inc. All rights reserved.
 # Unit tests for the test file parser
-#
-import logging
-import pytest
-from tests.util.test_file_parser import *
+
 from tests.common.base_test_suite import BaseTestSuite
+from tests.util.test_file_parser import parse_test_file_text
 
 test_text = """
 # Text before in the header (before the first ====) should be ignored

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/unittests/test_result_verifier.py
----------------------------------------------------------------------
diff --git a/tests/unittests/test_result_verifier.py b/tests/unittests/test_result_verifier.py
index 5568c51..8ef3f95 100644
--- a/tests/unittests/test_result_verifier.py
+++ b/tests/unittests/test_result_verifier.py
@@ -12,11 +12,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import logging
-import pytest
-from tests.common.test_result_verifier import *
 from tests.common.impala_test_suite import ImpalaTestSuite
 from tests.common.test_dimensions import create_uncompressed_text_dimension
+from tests.common.test_result_verifier import create_query_result
 
 # Unittest class for the test_result_verifier module.
 class TestResultVerifier(ImpalaTestSuite):

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/util/compute_table_stats.py
----------------------------------------------------------------------
diff --git a/tests/util/compute_table_stats.py b/tests/util/compute_table_stats.py
index 2bfaab8..130951d 100755
--- a/tests/util/compute_table_stats.py
+++ b/tests/util/compute_table_stats.py
@@ -14,9 +14,10 @@
 # limitations under the License.
 #
 # Utility for computing table statistics of tables in the Hive Metastore
-import sys
+
 from optparse import OptionParser
-from tests.beeswax.impala_beeswax import *
+
+from tests.beeswax.impala_beeswax import ImpalaBeeswaxClient
 
 def compute_stats(impala_client, db_names=None, table_names=None,
     continue_on_error=False):

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/util/hdfs_util.py
----------------------------------------------------------------------
diff --git a/tests/util/hdfs_util.py b/tests/util/hdfs_util.py
index 7870666..a42226e 100644
--- a/tests/util/hdfs_util.py
+++ b/tests/util/hdfs_util.py
@@ -14,15 +14,15 @@
 #
 # Hdfs access utilities
 
+import getpass
+import httplib
+import requests
 from os import environ
 from os.path import join as join_path
 from pywebhdfs.webhdfs import PyWebHdfsClient, errors, _raise_pywebhdfs_exception
 from xml.etree.ElementTree import parse
+
 from tests.util.filesystem_base import BaseFilesystem
-import getpass
-import httplib
-import requests
-import types
 
 class PyWebHdfsClientWithChmod(PyWebHdfsClient, BaseFilesystem):
   def chmod(self, path, permission):

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/util/plugin_runner.py
----------------------------------------------------------------------
diff --git a/tests/util/plugin_runner.py b/tests/util/plugin_runner.py
index 7f5e0e6..e6c88db 100644
--- a/tests/util/plugin_runner.py
+++ b/tests/util/plugin_runner.py
@@ -12,11 +12,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import imp
 import logging
 import os
 import pkgutil
-import sys
 
 PLUGIN_DIR = os.path.join(os.environ['IMPALA_HOME'], 'tests', 'benchmark', 'plugins')
 

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/util/s3_util.py
----------------------------------------------------------------------
diff --git a/tests/util/s3_util.py b/tests/util/s3_util.py
index 42e44e8..69d8654 100644
--- a/tests/util/s3_util.py
+++ b/tests/util/s3_util.py
@@ -18,7 +18,6 @@
 # to access Amazon S3.
 
 import boto3
-import copy
 from tests.util.filesystem_base import BaseFilesystem
 
 class S3Client(BaseFilesystem):
@@ -31,7 +30,7 @@ class S3Client(BaseFilesystem):
     self.s3client = boto3.client('s3')
 
   def create_file(self, path, file_data, overwrite=True):
-    if not overwrite and self.exists(filename): return False
+    if not overwrite and self.exists(path): return False
     self.s3client.put_object(Bucket=self.bucketname, Key=path, Body=file_data)
     return True
 

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/util/test_file_parser.py
----------------------------------------------------------------------
diff --git a/tests/util/test_file_parser.py b/tests/util/test_file_parser.py
index 6c3ffc2..5e73756 100644
--- a/tests/util/test_file_parser.py
+++ b/tests/util/test_file_parser.py
@@ -1,13 +1,13 @@
 # Copyright (c) 2012 Cloudera, Inc. All rights reserved.
 #
 # This module is used for common utilities related to parsing test files
-import collections
+
 import codecs
+import collections
 import logging
 import re
 from collections import defaultdict
-from os.path import isfile, isdir
-from tests.common.test_dimensions import TableFormatInfo
+from os.path import isfile
 from textwrap import dedent
 
 LOG = logging.getLogger('impala_test_suite')

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/verifiers/metric_verifier.py
----------------------------------------------------------------------
diff --git a/tests/verifiers/metric_verifier.py b/tests/verifiers/metric_verifier.py
index 51e1190..bcde3f5 100644
--- a/tests/verifiers/metric_verifier.py
+++ b/tests/verifiers/metric_verifier.py
@@ -14,8 +14,6 @@
 #
 # Verfier for common impalad metrics
 
-import pytest
-
 # List of metrics that should be equal to zero when there are no outstanding queries.
 METRIC_LIST = [
                # TODO (IMPALA-3377): Re-enable

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/609b8041/tests/verifiers/test_verify_metrics.py
----------------------------------------------------------------------
diff --git a/tests/verifiers/test_verify_metrics.py b/tests/verifiers/test_verify_metrics.py
index f3792db..3dcce2a 100644
--- a/tests/verifiers/test_verify_metrics.py
+++ b/tests/verifiers/test_verify_metrics.py
@@ -14,10 +14,7 @@
 #
 # Verification of impalad metrics after a test run.
 
-import logging
-import pytest
 from tests.common.impala_test_suite import ImpalaTestSuite
-from tests.common.test_vector import TestDimension
 from tests.verifiers.metric_verifier import MetricVerifier
 
 class TestValidateMetrics(ImpalaTestSuite):


Mime
View raw message