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

    https://github.com/apache/spark/pull/9922#discussion_r45792414
  
    --- Diff: python/pyspark/streaming/util.py ---
    @@ -62,9 +63,14 @@ def call(self, milliseconds, jrdds):
                 r = self.func(t, *rdds)
                 if r:
                     return r._jrdd
    -        except Exception:
    -            traceback.print_exc()
    -            raise
    +        except:
    +            self.failure = traceback.format_exc()
    +
    +    def getFailure(self):
    +        failure = self.failure
    +        # Clear the failure
    +        self.failure = None
    --- End diff --
    
    Isnt it more intuitive to clear the failure in the beginning of `call`? 
Otherwise, its weird semantics that successive calls to getFailure will return 
different things. Also weird that a `get` function has side effects.
    
    Also, better to name it `getLastFailure` to make it more clear that its the 
failure in the last call.


---
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