Beispiel #1
0
 def test_short_types(self):
     short_int = Integer(size=4)
     self.assertEquals(short_int.avro_type_name, 'int')
     long_int = Integer()
     self.assertEquals(long_int.avro_type_name, 'long')
     short_float = Float(size=4)
     self.assertEquals(short_float.avro_type_name, 'float')
     long_float = Float()
     self.assertEquals(long_float.avro_type_name, 'double')
Beispiel #2
0
class MyItem(Record):
    name = Text()
    value = Integer()
    dec = Float()
    flag = Boolean()
    date = Date()
    datehour = DateTime()
Beispiel #3
0
class SomeAvroRecord(Record):
    """SomeAvroRecord contains a lot of cool stuff"""
    a = Text()
    b = Integer()
    c = Bytes()
    d = Boolean()
    e = Float(description="hello world!")
    f = Enum(["FOO", "bar"])
    g = List(Text(), nullable=True)
    h = List(SubRecord(TextRecord))
    i = Map(Text(), nullable=True)
    j = Map(SubRecord(TextRecord))
    k = Date()
    l = DateTime()
    m = Text(nullable=False)
    n = Integer(nullable=False)
    o = Bytes(nullable=False)
    p = Boolean(nullable=False)
    q = Float(nullable=False)
    r = Enum(["FOO", "bar"], nullable=False)
    s = SubRecord(TextRecord, nullable=False)
    t = SubRecord(TextRecord2, nullable=False)
    u = SubRecord(TextRecord3)
Beispiel #4
0
class OutputRecord(pyschema.Record):
    foo = Text()
    barsum = Integer()
Beispiel #5
0
class InputRecord(pyschema.Record):
    foo = Text()
    bar = Integer()
Beispiel #6
0
 class ValidRecord(pyschema.Record):
     field = Integer()
Beispiel #7
0
 class Inner(Record):
     field = Integer()
Beispiel #8
0
 class FooRecord(pyschema.Record):
     foo = Text()
     bar = Integer()