GitHub user yuya-tajima opened a pull request:

    https://github.com/apache/beam/pull/2210

    [BEAM-1674] Add unicode type to the typeDict attribute in Python SDK

    When I executed Biq Query exection on the Google Cloud Dataflow,  the 
following error occurred.
    
    ```
    UnicodeEncodeError: 'ascii' codec can't encode characters in position 
73-78: ordinal not in range(128)
    ```
    
    It seems there is a problem when the executed SQL is UTF-8 strings(unicode 
type).
    
    ```python:apache_beam/transforms/display.py
        #TODO: Fix Args: documentation once the Python classes handling has 
changed
        type_ = cls.typeDict.get(type(value))
        if type_ is None:
          type_ = 'CLASS' if inspect.isclass(value) else None
        if type_ is None and value is None:
          type_ = 'STRING'
        return type_
    ```
    
    so unicode type is always considered as None type.
    
    So I fixed the problem the following code.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/yuya-tajima/beam master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/beam/pull/2210.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2210
    
----
commit 948b802fd35b1f810de30829fc2e46fcdbe6ce79
Author: tajima <taj...@tajima-taso.jp>
Date:   2017-03-09T09:08:25Z

    add unicode type to the typeDict attribute in Python SDK

----


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to