You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by yuya-tajima <gi...@git.apache.org> on 2017/03/09 10:13:54 UTC

[GitHub] beam pull request #2210: [BEAM-1674] Add unicode type to the typeDict attrib...

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

[GitHub] beam pull request #2210: [BEAM-1674] Add unicode type to the typeDict attrib...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


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