Github user xuanyuanking commented on a diff in the pull request: https://github.com/apache/spark/pull/22962#discussion_r233283645 --- Diff: python/pyspark/taskcontext.py --- @@ -147,8 +147,8 @@ def __init__(self): @classmethod def _getOrCreate(cls): """Internal function to get or create global BarrierTaskContext.""" - if cls._taskContext is None: - cls._taskContext = BarrierTaskContext() + if not isinstance(cls._taskContext, BarrierTaskContext): + cls._taskContext = object.__new__(cls) --- End diff -- ``` could you add some comments to explain it? ``` @cloud-fan Sorry for the less explain and more comments should be done at first, will done in follow up PR. ``` Can we get rid of the rewrite all? we should remove __init__ too next time please fully describe what's going on in PR description ``` @HyukjinKwon Sorry for the less explain, all these will be done in next follow up PR, and the new UT.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org