Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21107#discussion_r183428356
  
    --- Diff: python/pyspark/ml/tests.py ---
    @@ -2136,17 +2136,23 @@ class ImageReaderTest2(PySparkTestCase):
         @classmethod
         def setUpClass(cls):
             super(ImageReaderTest2, cls).setUpClass()
    +        cls.hive_available = True
             # Note that here we enable Hive's support.
             cls.spark = None
             try:
                 cls.sc._jvm.org.apache.hadoop.hive.conf.HiveConf()
             except py4j.protocol.Py4JError:
                 cls.tearDownClass()
    -            raise unittest.SkipTest("Hive is not available")
    +            cls.hive_available = False
             except TypeError:
                 cls.tearDownClass()
    -            raise unittest.SkipTest("Hive is not available")
    -        cls.spark = HiveContext._createForTesting(cls.sc)
    +            cls.hive_available = False
    +        if cls.hive_available:
    +            cls.spark = HiveContext._createForTesting(cls.sc)
    +
    +    def setUp(self):
    +        if not self.hive_available:
    +            self.skipTest("Hive is not available.")
    --- End diff --
    
    No clean way as far as I can tell. I should do another regex thing but .. I 
would like to avoid this way as possible as I can ..


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to