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

    https://github.com/apache/spark/pull/5445#discussion_r28199394
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -997,12 +997,13 @@ def _restore_object(dataType, obj):
         # same object in most cases.
         k = id(dataType)
         cls = _cached_cls.get(k)
    -    if cls is None:
    +    if cls is None or cls.__datatype is not dataType:
    --- End diff --
    
    Do we need this check for correctness?  If I understand the rest of this 
patch correctly, won't the write to `cls.__datatype` down on line 1006 mean 
that we'll retain a strong reference to the DataType as long as the Row class 
is still referenced, preventing the re-use of the DataType's object id?
    
    If we expect this check to never return true, should we turn it into an 
assertion or log a warning if it's true?


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