[ 
https://issues.apache.org/jira/browse/BEAM-7198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Valentyn Tymofieiev updated BEAM-7198:
--------------------------------------
    Description: 
The name of ToStringCoder class [1] is confusing, since the output of encode() 
on Python3 will be bytes. On Python 2 the output is also bytes, since bytes and 
string are synonyms on Py2.

ToBytesCoder would be a better name for this class. 

Note that this class is not listed in coders that constitute Public APIs [2], 
so we can treat this as internal change. As a courtesy to users  who happened 
to reference a non-public coder in their pipelines we can keep the old class 
name as an alias, e.g. ToStringCoder = ToBytesCoder to avoid friction, but 
clean up Beam codeabase to use the new name.

[1] 
https://github.com/apache/beam/blob/ef4b2ef7e5fa2fb87e1491df82d2797947f51be9/sdks/python/apache_beam/coders/coders.py#L344

[2] 
https://github.com/apache/beam/blob/ef4b2ef7e5fa2fb87e1491df82d2797947f51be9/sdks/python/apache_beam/coders/coders.py#L20

cc: [~yoshiki.obata] [~chamikara]

  was:
The name of ToStringCoder class [1] is confusing, since the output of encode() 
on Python3 will be bytes. On Python 2 the output is also bytes, since bytes and 
string a synonyms on Py2.

ToBytesCoder would be a better name for this class. 

Note that this class is not listed in coders that constitute Public APIs [2], 
so we can treat this as internal change. As a courtesy to users  who happened 
to reference a non-public coder in their pipelines we can keep the old class 
name as an alias, e.g. ToStringCoder = ToBytesCoder to avoid friction, but 
clean up Beam codeabase to use the new name.

[1] 
https://github.com/apache/beam/blob/ef4b2ef7e5fa2fb87e1491df82d2797947f51be9/sdks/python/apache_beam/coders/coders.py#L344

[2] 
https://github.com/apache/beam/blob/ef4b2ef7e5fa2fb87e1491df82d2797947f51be9/sdks/python/apache_beam/coders/coders.py#L20

cc: [~yoshiki.obata] [~chamikara]


> Rename ToStringCoder into ToBytesCoder
> --------------------------------------
>
>                 Key: BEAM-7198
>                 URL: https://issues.apache.org/jira/browse/BEAM-7198
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Valentyn Tymofieiev
>            Priority: Minor
>
> The name of ToStringCoder class [1] is confusing, since the output of 
> encode() on Python3 will be bytes. On Python 2 the output is also bytes, 
> since bytes and string are synonyms on Py2.
> ToBytesCoder would be a better name for this class. 
> Note that this class is not listed in coders that constitute Public APIs [2], 
> so we can treat this as internal change. As a courtesy to users  who happened 
> to reference a non-public coder in their pipelines we can keep the old class 
> name as an alias, e.g. ToStringCoder = ToBytesCoder to avoid friction, but 
> clean up Beam codeabase to use the new name.
> [1] 
> https://github.com/apache/beam/blob/ef4b2ef7e5fa2fb87e1491df82d2797947f51be9/sdks/python/apache_beam/coders/coders.py#L344
> [2] 
> https://github.com/apache/beam/blob/ef4b2ef7e5fa2fb87e1491df82d2797947f51be9/sdks/python/apache_beam/coders/coders.py#L20
> cc: [~yoshiki.obata] [~chamikara]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to