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

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


The following commit(s) were added to refs/heads/master by this push:
     new 203f9b1  Tests for string_utf8 standard coder.
     new b9eb0f6  Merge pull request #8277 Tests for string_utf8 standard coder.
203f9b1 is described below

commit 203f9b1f334418cc861c2e3b0eae76e7208bf055
Author: Robert Bradshaw <rober...@gmail.com>
AuthorDate: Thu Apr 11 15:36:22 2019 +0200

    Tests for string_utf8 standard coder.
---
 .../apache_beam/coders/standard_coders_test.py     |  1 +
 .../apache_beam/testing/data/standard_coders.yaml  | 24 ++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/sdks/python/apache_beam/coders/standard_coders_test.py 
b/sdks/python/apache_beam/coders/standard_coders_test.py
index 79c06f4..b4d8443 100644
--- a/sdks/python/apache_beam/coders/standard_coders_test.py
+++ b/sdks/python/apache_beam/coders/standard_coders_test.py
@@ -58,6 +58,7 @@ class StandardCodersTest(unittest.TestCase):
 
   _urn_to_json_value_parser = {
       'beam:coder:bytes:v1': lambda x: x.encode('utf-8'),
+      'beam:coder:string_utf8:v1': lambda x: x,
       'beam:coder:varint:v1': lambda x: x,
       'beam:coder:kv:v1':
           lambda x, key_parser, value_parser: (key_parser(x['key']),
diff --git a/sdks/python/apache_beam/testing/data/standard_coders.yaml 
b/sdks/python/apache_beam/testing/data/standard_coders.yaml
index 9eb4195..e3927ab 100644
--- a/sdks/python/apache_beam/testing/data/standard_coders.yaml
+++ b/sdks/python/apache_beam/testing/data/standard_coders.yaml
@@ -58,6 +58,30 @@ examples:
 ---
 
 coder:
+  urn: "beam:coder:string_utf8:v1"
+nested: false
+examples:
+  "abc": abc
+  "ab\0c": "ab\0c"
+  "\u00c3\u00bf": "\u00ff"
+  "\u00e5\u0085\u0089\u00e7\u00ba\u00bf": "光线"
+
+---
+
+coder:
+  urn: "beam:coder:string_utf8:v1"
+nested: true
+examples:
+  "\u0003abc": abc
+  "\u0004ab\0c": "ab\0c"
+  "\u0002\u00c3\u00bf": "\u00ff"
+  "\u0006\u00e5\u0085\u0089\u00e7\u00ba\u00bf": "光线"
+  "\u00c8\u0001       10|       20|       30|       40|       50|       60|    
   70|       80|       90|      100|      110|      120|      130|      140|    
  150|      160|      170|      180|      190|      200|":
+              "       10|       20|       30|       40|       50|       60|    
   70|       80|       90|      100|      110|      120|      130|      140|    
  150|      160|      170|      180|      190|      200|"
+
+---
+
+coder:
   urn: "beam:coder:varint:v1"
 examples:
   "\0": 0

Reply via email to