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

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

                Author: ASF GitHub Bot
            Created on: 19/Nov/18 23:27
            Start Date: 19/Nov/18 23:27
    Worklog Time Spent: 10m 
      Work Description: tvalentyn commented on a change in pull request #7029: 
[BEAM-5320] Finish Python 3 porting for testing module
URL: https://github.com/apache/beam/pull/7029#discussion_r234820636
 
 

 ##########
 File path: sdks/python/apache_beam/testing/test_utils.py
 ##########
 @@ -79,7 +79,7 @@ def compute_hash(content, hashing_alg=DEFAULT_HASHING_ALG):
   content.sort()
   m = hashlib.new(hashing_alg)
   for elem in content:
-    m.update(str(elem).encode('utf-8'))
+    m.update(elem)
 
 Review comment:
   1. The docstring for ```compute_hash``` does not reflect the current usage 
of this method in the codebase. IMO, the docstring should say something like:
      ```"""Compute a hash value of a list of objects by hashing their string 
representations."""```
    Let's fix it. 
   2. ```hashib``` [expects](https://docs.python.org/3/library/hashlib.html) 
```bytes``` in ```hash.update()```. So, encoding strings to bytes seems to be 
the right thing - what is the issue with current implementation?
   3. ```compute_hash``` currently has little usage, so we could decide in 
favor of a different hashing mechanism if there  are some strong reasons to do 
so.

----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 167543)
    Time Spent: 2h 50m  (was: 2h 40m)

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




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

Reply via email to