[ 
https://issues.apache.org/jira/browse/BEAM-7389?focusedWorklogId=293398&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-293398
 ]

ASF GitHub Bot logged work on BEAM-7389:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/Aug/19 21:22
            Start Date: 12/Aug/19 21:22
    Worklog Time Spent: 10m 
      Work Description: davidcavazos commented on pull request #9289: 
[BEAM-7389] Add code examples for ToString page
URL: https://github.com/apache/beam/pull/9289#discussion_r313133987
 
 

 ##########
 File path: website/src/documentation/transforms/python/element-wise/tostring.md
 ##########
 @@ -19,9 +19,38 @@ limitations under the License.
 -->
 
 # ToString
+
+<script type="text/javascript">
+localStorage.setItem('language', 'language-py')
+</script>
+
 Transforms every element in an input collection a string.
 
-## Examples
-See [BEAM-7389](https://issues.apache.org/jira/browse/BEAM-7389) for updates. 
+## Example
+
+Any non-string element can be converted to a string using sandard Python 
functions and methods.
+Many I/O transforms such as `TextIO` expect their input elements to be strings.
+
+```py
+{% github_sample 
/apache/beam/blob/master/sdks/python/apache_beam/examples/snippets/transforms/element_wise/to_string.py
 tag:to_string %}```
+
+Output `PCollection` after *to string*:
 
 Review comment:
   I just replaced the "after to string" with "as strings". I'm hesitant to say 
that it's the output of the *pipeline* because the `print` function returns 
`None`, so the output to the pipeline is actually a `PCollection` of all 
`None`s. For testing we hack around that by mocking the print function to use 
`lambda element: element`. 
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 293398)
    Time Spent: 42h 50m  (was: 42h 40m)

> Colab examples for element-wise transforms (Python)
> ---------------------------------------------------
>
>                 Key: BEAM-7389
>                 URL: https://issues.apache.org/jira/browse/BEAM-7389
>             Project: Beam
>          Issue Type: Improvement
>          Components: website
>            Reporter: Rose Nguyen
>            Assignee: David Cavazos
>            Priority: Minor
>          Time Spent: 42h 50m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to