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

    https://github.com/apache/spark/pull/18444#discussion_r128140334
  
    --- Diff: python/pyspark/sql/types.py ---
    @@ -938,12 +1016,17 @@ def _infer_type(obj):
                     return MapType(_infer_type(key), _infer_type(value), True)
             else:
                 return MapType(NullType(), NullType(), True)
    -    elif isinstance(obj, (list, array)):
    +    elif isinstance(obj, list):
             for v in obj:
                 if v is not None:
                     return ArrayType(_infer_type(obj[0]), True)
             else:
                 return ArrayType(NullType(), True)
    +    elif isinstance(obj, array):
    +        if obj.typecode in _array_type_mappings:
    +            return ArrayType(_array_type_mappings[obj.typecode](), False)
    +        else:
    +            raise TypeError("not supported type: array(%s)" % obj.typecode)
    --- End diff --
    
    > Should we add 'L' as exception for python2 in unsupported types tests, or 
do we just completely remove unsupported tests?
    
    I'd prefer 'L' as exception for Python 2.
    
    > Should we test 'L' for python 2?
    
    I don't think we should explicitly test this here. I guess we mistakenly 
happened to support this case as you said.
    
    I think I (we contributors) can't make this decision (by rule) to remove 
this 'L' support ("undefined support status") but I would like to push this PR 
forward and this is why I was thinking deferring to a separate PR.
    
    cc @ueshin, are you online now? WDYT removing out (unexpected I guess) 'L' 
support in Python 2?



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