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

    https://github.com/apache/spark/pull/17267#discussion_r105653661
  
    --- Diff: python/pyspark/sql/utils.py ---
    @@ -24,7 +24,7 @@ def __init__(self, desc, stackTrace):
             self.stackTrace = stackTrace
     
         def __str__(self):
    -        return repr(self.desc)
    +        return str(self.desc)
    --- End diff --
    
    Hm.. does this work for `unicode` in Python 2.7, for example, 
`spark.range(1).select("아")`? Up to my knowledge, converting it to ascii 
directly throws an exception.
    
    ```python
    >>> str(u"아")
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    UnicodeEncodeError: 'ascii' codec can't encode character u'\uc544' in 
position 0: ordinal not in range(128)
    >>> repr(u"아")
    "u'\\uc544'"
    ```
    
    Maybe, we should check if this is `unicode` and do `.encode`.


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