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

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

                Author: ASF GitHub Bot
            Created on: 28/Jan/19 16:17
            Start Date: 28/Jan/19 16:17
    Worklog Time Spent: 10m 
      Work Description: tvalentyn commented on pull request #7583: [BEAM-5313] 
Python 3 port examples package
URL: https://github.com/apache/beam/pull/7583#discussion_r251485300
 
 

 ##########
 File path: sdks/python/apache_beam/examples/complete/tfidf_test.py
 ##########
 @@ -85,8 +85,8 @@ def test_basics(self):
     with open_shards(os.path.join(
         temp_folder, 'result-*-of-*')) as result_file:
       for line in result_file:
-        match = re.search(EXPECTED_LINE_RE, line)
-        logging.info('Result line: %s', line)
+        match = re.search(EXPECTED_LINE_RE, line.decode('utf-8'))
 
 Review comment:
   How about we do the following:
   1. Make `open_shards` accept glob_pattern + arguments of `io.open()`, using 
the same defaults.
   2. Use `io.open()` instead of builtin `open` in last line of `open_shards` 
and pass the input arguments.  io.open() interface is consistent between Py2 
and Py3.  
   3. Make it a responsibility of individual tests whether they want to read 
text or binary, and/or pass encoding. 
   
   Looks like we won't have to modify test files in this case, since by default 
we will be opening files as text.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 191101)
    Time Spent: 2h  (was: 1h 50m)

> Finish Python 3 porting for examples module
> -------------------------------------------
>
>                 Key: BEAM-5313
>                 URL: https://issues.apache.org/jira/browse/BEAM-5313
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>            Reporter: Robbe
>            Assignee: Robbe
>            Priority: Major
>          Time Spent: 2h
>  Remaining Estimate: 0h
>




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

Reply via email to