25
25
b'\xef ' ,
26
26
'John Doe' ,
27
27
100 ,
28
- {
29
- 'name' : 'John Doe' ,
30
- 'age' : 100 ,
31
- },
28
+ 'John Doe 2' ,
29
+ 200 ,
32
30
[1 , 2 , 3 ],
33
31
]
34
32
46
44
'name' : 'John Doe' ,
47
45
'age' : 100 ,
48
46
},
47
+ {
48
+ 'record' : {
49
+ 'name' : 'John Doe 2' ,
50
+ 'age' : 200 ,
51
+ }
52
+ },
49
53
[1 , 2 , 3 ],
50
54
]
51
55
73
77
{'name' : 'bytes' , 'type' : types .BINARY (), 'nullable' : True , 'default' : None },
74
78
{'name' : 'record.name' , 'type' : types .String (), 'nullable' : True , 'default' : None },
75
79
{'name' : 'record.age' , 'type' : types .Integer (), 'nullable' : True , 'default' : None },
76
- {'name' : 'record' , 'type' : types .JSON (), 'nullable' : True , 'default' : None },
80
+ {'name' : 'nested_record.record.name' , 'type' : types .String (), 'nullable' : True , 'default' : None },
81
+ {'name' : 'nested_record.record.age' , 'type' : types .Integer (), 'nullable' : True , 'default' : None },
77
82
{'name' : 'array' , 'type' : types .ARRAY (types .Integer ()), 'nullable' : True , 'default' : None },
78
83
]
79
84
@@ -128,7 +133,8 @@ def query(table):
128
133
129
134
130
135
def test_reflect_select (engine , table ):
131
- assert len (table .c ) == 13
136
+ assert len (table .c ) == 14
137
+
132
138
assert isinstance (table .c .integer , Column )
133
139
assert isinstance (table .c .integer .type , types .Integer )
134
140
assert isinstance (table .c .timestamp .type , types .TIMESTAMP )
@@ -139,7 +145,10 @@ def test_reflect_select(engine, table):
139
145
assert isinstance (table .c .datetime .type , types .DATETIME )
140
146
assert isinstance (table .c .time .type , types .TIME )
141
147
assert isinstance (table .c .bytes .type , types .BINARY )
142
- assert isinstance (table .c .record .type , types .JSON )
148
+ assert isinstance (table .c ['record.age' ].type , types .Integer )
149
+ assert isinstance (table .c ['record.name' ].type , types .String )
150
+ assert isinstance (table .c ['nested_record.record.age' ].type , types .Integer )
151
+ assert isinstance (table .c ['nested_record.record.name' ].type , types .String )
143
152
assert isinstance (table .c .array .type , types .ARRAY )
144
153
145
154
rows = table .select ().execute ().fetchall ()
0 commit comments