def test_array(self): self._assert_schemas_equal( _infer_schema({'foo': 1, 'bar': ['hello']}), { 'type': 'record', 'fields': [ {'type': 'int', 'name': 'foo'}, {'type': {'type': 'array', 'items': 'string'}, 'name': 'bar'}, ] } )
def test_flat_record(self): self._assert_schemas_equal( _infer_schema({'foo': 1, 'bar': 'hello'}), { 'type': 'record', 'fields': [ {'type': 'int', 'name': 'foo'}, {'type': 'string', 'name': 'bar'}, ] } )
def test_flat_record(self): self._assert_schemas_equal( _infer_schema({ 'foo': 1, 'bar': 'hello' }), { 'type': 'record', 'fields': [ { 'type': 'int', 'name': 'foo' }, { 'type': 'string', 'name': 'bar' }, ] })
def test_array(self): self._assert_schemas_equal( _infer_schema({ 'foo': 1, 'bar': ['hello'] }), { 'type': 'record', 'fields': [ { 'type': 'int', 'name': 'foo' }, { 'type': { 'type': 'array', 'items': 'string' }, 'name': 'bar' }, ] })