avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1056519 - in /avro/trunk: CHANGES.txt lang/py/src/avro/schema.py lang/py/test/test_protocol.py
Date Fri, 07 Jan 2011 21:23:55 GMT
Author: cutting
Date: Fri Jan  7 21:23:55 2011
New Revision: 1056519

URL: http://svn.apache.org/viewvc?rev=1056519&view=rev
Log:
AVRO-694. Python: Fix schema parse error for maps of records.  Contributed by hammer.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/py/src/avro/schema.py
    avro/trunk/lang/py/test/test_protocol.py

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1056519&r1=1056518&r2=1056519&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Fri Jan  7 21:23:55 2011
@@ -127,6 +127,9 @@ Avro 1.5.0 (unreleased)
     AVRO-708. Java: Fix Netty-based RPC to keep connection open.
     (Stephen Gargan via cutting)
 
+    AVRO-694. Python: Fix schema parse error for maps of records.
+    (hammer via cutting)
+
 Avro 1.4.1 (13 October 2010)
 
   NEW FEATURES

Modified: avro/trunk/lang/py/src/avro/schema.py
URL: http://svn.apache.org/viewvc/avro/trunk/lang/py/src/avro/schema.py?rev=1056519&r1=1056518&r2=1056519&view=diff
==============================================================================
--- avro/trunk/lang/py/src/avro/schema.py (original)
+++ avro/trunk/lang/py/src/avro/schema.py Fri Jan  7 21:23:55 2011
@@ -464,7 +464,7 @@ class MapSchema(Schema):
 
     # Add class members
     if isinstance(values, basestring) and names.has_name(values, None):
-      values_schema = names.get_name(values)
+      values_schema = names.get_name(values, None)
     else:
       try:
         values_schema = make_avsc_object(values, names)

Modified: avro/trunk/lang/py/test/test_protocol.py
URL: http://svn.apache.org/viewvc/avro/trunk/lang/py/test/test_protocol.py?rev=1056519&r1=1056518&r2=1056519&view=diff
==============================================================================
--- avro/trunk/lang/py/test/test_protocol.py (original)
+++ avro/trunk/lang/py/test/test_protocol.py Fri Jan  7 21:23:55 2011
@@ -304,6 +304,42 @@ ExampleProtocol("""\
 
 }
     """, True),
+  ExampleProtocol("""\
+{
+  "protocol" : "API",
+  "namespace" : "xyz.api",
+  "types" : [ {
+    "type" : "enum",
+    "name" : "Symbology",
+    "namespace" : "xyz.api.product",
+    "symbols" : [ "OPRA", "CUSIP", "ISIN", "SEDOL" ]
+  }, {
+    "type" : "record",
+    "name" : "Symbol",
+    "namespace" : "xyz.api.product",
+    "fields" : [ {
+      "name" : "symbology",
+      "type" : "xyz.api.product.Symbology"
+    }, {
+      "name" : "symbol",
+      "type" : "string"
+    } ]
+  }, {
+    "type" : "record",
+    "name" : "MultiSymbol",
+    "namespace" : "xyz.api.product",
+    "fields" : [ {
+      "name" : "symbols",
+      "type" : {
+        "type" : "map",
+        "values" : "xyz.api.product.Symbol"
+      }
+    } ]
+  } ],
+  "messages" : {
+  }
+}
+    """, True),
 ]
 
 VALID_EXAMPLES = [e for e in EXAMPLES if e.valid]



Mime
View raw message