You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ch...@apache.org on 2019/06/13 20:02:17 UTC

[beam] branch master updated (e933ddc -> 8c8ca66)

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

chamikara pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git.


    from e933ddc  Adding helper functions, and documentation to fn_api_runner classes. (#8793)
     add 4e05a7f  Read YAML as binary stream in standard_coders_test.
     new 8c8ca66  Merge pull request: [BEAM-5270] Read YAML as binary stream in standard_coders_test

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.


Summary of changes:
 sdks/python/apache_beam/coders/standard_coders_test.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)


[beam] 01/01: Merge pull request: [BEAM-5270] Read YAML as binary stream in standard_coders_test

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

chamikara pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git

commit 8c8ca6620da5b262ab7b148870556c5342a138a4
Merge: e933ddc 4e05a7f
Author: Chamikara Jayalath <ch...@apache.org>
AuthorDate: Thu Jun 13 13:02:00 2019 -0700

    Merge pull request: [BEAM-5270] Read YAML as binary stream in standard_coders_test

 sdks/python/apache_beam/coders/standard_coders_test.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --cc sdks/python/apache_beam/coders/standard_coders_test.py
index 2ad5ad4,67b3e07..b16a8f5
--- a/sdks/python/apache_beam/coders/standard_coders_test.py
+++ b/sdks/python/apache_beam/coders/standard_coders_test.py
@@@ -49,21 -48,13 +49,22 @@@ def _load_test_cases(test_yaml)
    """
    if not os.path.exists(test_yaml):
      raise ValueError('Could not find the test spec: %s' % test_yaml)
-   for ix, spec in enumerate(yaml.load_all(open(test_yaml))):
-     spec['index'] = ix
-     name = spec.get('name', spec['coder']['urn'].split(':')[-2])
-     yield [name, spec]
+   with open(test_yaml, 'rb') as coder_spec:
+     for ix, spec in enumerate(yaml.load_all(coder_spec)):
+       spec['index'] = ix
+       name = spec.get('name', spec['coder']['urn'].split(':')[-2])
+       yield [name, spec]
  
  
 +def parse_float(s):
 +  x = float(s)
 +  if math.isnan(x):
 +    # In Windows, float('NaN') has opposite sign from other platforms.
 +    # For the purpose of this test, we just need consistency.
 +    x = abs(x)
 +  return x
 +
 +
  class StandardCodersTest(unittest.TestCase):
  
    _urn_to_json_value_parser = {