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

    https://github.com/apache/spark/pull/10126#discussion_r49646581
  
    --- Diff: python/pyspark/sql/context.py ---
    @@ -686,9 +686,10 @@ def _ssql_ctx(self):
                     self._scala_HiveContext = self._get_hive_ctx()
                 return self._scala_HiveContext
             except Py4JError as e:
    -            raise Exception("You must build Spark with Hive. "
    -                            "Export 'SPARK_HIVE=true' and run "
    -                            "build/sbt assembly", e)
    +            warnings.warn("You must build Spark with Hive. "
    +                          "Export 'SPARK_HIVE=true' and run "
    +                          "build/sbt assembly")
    +            raise e
    --- End diff --
    
    Can you please use `raise` instead of `raise e` here in order to preserve 
the original stacktrace? See 
http://nedbatchelder.com/blog/200711/rethrowing_exceptions_in_python.html. It's 
not a huge deal, but I'd like to use the proper idiom for re-throwing 
exceptions in order to set a good example for future readers of this code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to