You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/10/29 22:21:58 UTC

[GitHub] [spark] jiangxb1987 commented on a change in pull request #26239: [SPARK-29582][PYSPARK] Support `TaskContext.get()` in a barrier task from Python side

jiangxb1987 commented on a change in pull request #26239: [SPARK-29582][PYSPARK] Support `TaskContext.get()` in a barrier task from Python side
URL: https://github.com/apache/spark/pull/26239#discussion_r340353839
 
 

 ##########
 File path: python/pyspark/taskcontext.py
 ##########
 @@ -162,7 +166,10 @@ def get(cls):
         running tasks.
 
         .. note:: Must be called on the worker, not the driver. Returns None if not initialized.
+            A RuntimeError will raise if it is not in a barrier stage.
         """
+        if not isinstance(cls._taskContext, BarrierTaskContext):
+            raise RuntimeError('''It is not in a barrier stage''')
 
 Review comment:
   This is not supported behavior, so please raise `Exception` instead of `RuntimeError`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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