Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21383#discussion_r189900650
  
    --- Diff: python/pyspark/shuffle.py ---
    @@ -67,6 +67,19 @@ def get_used_memory():
             return 0
     
     
    +def safe_iter(f):
    +    """ wraps f to make it safe (= does not lead to data loss) to use 
inside a for loop
    +        make StopIteration's raised inside f explicit
    +    """
    +    def wrapper(*args, **kwargs):
    +        try:
    +            return f(*args, **kwargs)
    +        except StopIteration as exc:
    +            raise RuntimeError('StopIteration in client code', exc)
    --- End diff --
    
    oh sorry I misread it as `client mode`, it's actually `client code`, LGTM 
then


---

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

Reply via email to