You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by al...@apache.org on 2018/10/09 23:01:05 UTC

[beam] branch revert-6610-fixAssert created (now 0543a1a)

This is an automated email from the ASF dual-hosted git repository.

altay pushed a change to branch revert-6610-fixAssert
in repository https://gitbox.apache.org/repos/asf/beam.git.


      at 0543a1a  Revert "[BEAM-5627] Fix the issue of using str while byte is required in a few unit tests"

This branch includes the following new commits:

     new 0543a1a  Revert "[BEAM-5627] Fix the issue of using str while byte is required in a few unit tests"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[beam] 01/01: Revert "[BEAM-5627] Fix the issue of using str while byte is required in a few unit tests"

Posted by al...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

altay pushed a commit to branch revert-6610-fixAssert
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 0543a1a23727b79cb673b9fee795dc32bf358bed
Author: Ahmet Altay <aa...@gmail.com>
AuthorDate: Tue Oct 9 16:00:56 2018 -0700

    Revert "[BEAM-5627] Fix the issue of using str while byte is required in a few unit tests"
---
 sdks/python/apache_beam/io/filesystems_test.py | 6 +++---
 sdks/python/apache_beam/io/sources_test.py     | 5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/sdks/python/apache_beam/io/filesystems_test.py b/sdks/python/apache_beam/io/filesystems_test.py
index 4b5cc4d..383eb40 100644
--- a/sdks/python/apache_beam/io/filesystems_test.py
+++ b/sdks/python/apache_beam/io/filesystems_test.py
@@ -204,7 +204,7 @@ class FileSystemsTest(unittest.TestCase):
     path1 = os.path.join(path_t1, 'f1')
     path2 = os.path.join(path_t2, 'f1')
     with open(path1, 'a') as f:
-      f.write(b'Hello')
+      f.write('Hello')
 
     FileSystems.rename([path_t1], [path_t2])
     self.assertTrue(FileSystems.exists(path_t2))
@@ -216,7 +216,7 @@ class FileSystemsTest(unittest.TestCase):
     path1 = os.path.join(self.tmpdir, 'f1')
     path2 = os.path.join(self.tmpdir, 'f2')
     with open(path1, 'a') as f:
-      f.write(b'Hello')
+      f.write('Hello')
     self.assertTrue(FileSystems.exists(path1))
     self.assertFalse(FileSystems.exists(path2))
 
@@ -224,7 +224,7 @@ class FileSystemsTest(unittest.TestCase):
     path1 = os.path.join(self.tmpdir, 'f1')
 
     with open(path1, 'a') as f:
-      f.write(b'Hello')
+      f.write('Hello')
 
     self.assertTrue(FileSystems.exists(path1))
     FileSystems.delete([path1])
diff --git a/sdks/python/apache_beam/io/sources_test.py b/sdks/python/apache_beam/io/sources_test.py
index 1b95114..1e7de57 100644
--- a/sdks/python/apache_beam/io/sources_test.py
+++ b/sdks/python/apache_beam/io/sources_test.py
@@ -53,7 +53,7 @@ class LineSource(iobase.BoundedSource):
       for line in f:
         if not range_tracker.try_claim(current):
           return
-        yield line.decode().rstrip('\n')
+        yield line.rstrip('\n')
         current += len(line)
 
   def split(self, desired_bundle_size, start_position=None, stop_position=None):
@@ -83,6 +83,7 @@ class LineSource(iobase.BoundedSource):
 
 
 class SourcesTest(unittest.TestCase):
+
   @classmethod
   def setUpClass(cls):
     # Method has been renamed in Python 3
@@ -91,7 +92,7 @@ class SourcesTest(unittest.TestCase):
 
   def _create_temp_file(self, contents):
     with tempfile.NamedTemporaryFile(delete=False) as f:
-      f.write(contents.encode())
+      f.write(contents)
       return f.name
 
   @unittest.skipIf(sys.version_info[0] == 3 and