@@ -185,54 +185,103 @@ async def test_as_class(
185
185
["Some String" , "Some String" ],
186
186
),
187
187
("BOOL ARRAY" , [True , False ], [True , False ]),
188
+ ("BOOL ARRAY" , [[True ], [False ]], [[True ], [False ]]),
188
189
("INT2 ARRAY" , [SmallInt (12 ), SmallInt (100 )], [12 , 100 ]),
190
+ ("INT2 ARRAY" , [[SmallInt (12 )], [SmallInt (100 )]], [[12 ], [100 ]]),
189
191
("INT4 ARRAY" , [Integer (121231231 ), Integer (121231231 )], [121231231 , 121231231 ]),
192
+ ("INT4 ARRAY" , [[Integer (121231231 )], [Integer (121231231 )]], [[121231231 ], [121231231 ]]),
190
193
(
191
194
"INT8 ARRAY" ,
192
195
[BigInt (99999999999999999 ), BigInt (99999999999999999 )],
193
196
[99999999999999999 , 99999999999999999 ],
194
197
),
198
+ (
199
+ "INT8 ARRAY" ,
200
+ [[BigInt (99999999999999999 )], [BigInt (99999999999999999 )]],
201
+ [[99999999999999999 ], [99999999999999999 ]],
202
+ ),
195
203
(
196
204
"MONEY ARRAY" ,
197
205
[Money (99999999999999999 ), Money (99999999999999999 )],
198
206
[99999999999999999 , 99999999999999999 ],
199
207
),
208
+ (
209
+ "MONEY ARRAY" ,
210
+ [[Money (99999999999999999 )], [Money (99999999999999999 )]],
211
+ [[99999999999999999 ], [99999999999999999 ]],
212
+ ),
200
213
(
201
214
"NUMERIC(5, 2) ARRAY" ,
202
215
[Decimal ("121.23" ), Decimal ("188.99" )],
203
216
[Decimal ("121.23" ), Decimal ("188.99" )],
204
217
),
218
+ (
219
+ "NUMERIC(5, 2) ARRAY" ,
220
+ [[Decimal ("121.23" )], [Decimal ("188.99" )]],
221
+ [[Decimal ("121.23" )], [Decimal ("188.99" )]],
222
+ ),
205
223
(
206
224
"FLOAT8 ARRAY" ,
207
225
[32.12329864501953 , 32.12329864501953 ],
208
226
[32.12329864501953 , 32.12329864501953 ],
209
227
),
228
+ (
229
+ "FLOAT8 ARRAY" ,
230
+ [[32.12329864501953 ], [32.12329864501953 ]],
231
+ [[32.12329864501953 ], [32.12329864501953 ]],
232
+ ),
210
233
(
211
234
"DATE ARRAY" ,
212
235
[now_datetime .date (), now_datetime .date ()],
213
236
[now_datetime .date (), now_datetime .date ()],
214
237
),
238
+ (
239
+ "DATE ARRAY" ,
240
+ [[now_datetime .date ()], [now_datetime .date ()]],
241
+ [[now_datetime .date ()], [now_datetime .date ()]],
242
+ ),
215
243
(
216
244
"TIME ARRAY" ,
217
245
[now_datetime .time (), now_datetime .time ()],
218
246
[now_datetime .time (), now_datetime .time ()],
219
247
),
248
+ (
249
+ "TIME ARRAY" ,
250
+ [[now_datetime .time ()], [now_datetime .time ()]],
251
+ [[now_datetime .time ()], [now_datetime .time ()]],
252
+ ),
220
253
("TIMESTAMP ARRAY" , [now_datetime , now_datetime ], [now_datetime , now_datetime ]),
254
+ ("TIMESTAMP ARRAY" , [[now_datetime ], [now_datetime ]], [[now_datetime ], [now_datetime ]]),
221
255
(
222
256
"TIMESTAMPTZ ARRAY" ,
223
257
[now_datetime_with_tz , now_datetime_with_tz ],
224
258
[now_datetime_with_tz , now_datetime_with_tz ],
225
259
),
260
+ (
261
+ "TIMESTAMPTZ ARRAY" ,
262
+ [[now_datetime_with_tz ], [now_datetime_with_tz ]],
263
+ [[now_datetime_with_tz ], [now_datetime_with_tz ]],
264
+ ),
226
265
(
227
266
"UUID ARRAY" ,
228
267
[uuid_ , uuid_ ],
229
268
[str (uuid_ ), str (uuid_ )],
230
269
),
270
+ (
271
+ "UUID ARRAY" ,
272
+ [[uuid_ ], [uuid_ ]],
273
+ [[str (uuid_ )], [str (uuid_ )]],
274
+ ),
231
275
(
232
276
"INET ARRAY" ,
233
277
[IPv4Address ("192.0.0.1" ), IPv4Address ("192.0.0.1" )],
234
278
[IPv4Address ("192.0.0.1" ), IPv4Address ("192.0.0.1" )],
235
279
),
280
+ (
281
+ "INET ARRAY" ,
282
+ [[IPv4Address ("192.0.0.1" )], [IPv4Address ("192.0.0.1" )]],
283
+ [[IPv4Address ("192.0.0.1" )], [IPv4Address ("192.0.0.1" )]],
284
+ ),
236
285
(
237
286
"JSONB ARRAY" ,
238
287
[
@@ -256,6 +305,37 @@ async def test_as_class(
256
305
},
257
306
],
258
307
),
308
+ (
309
+ "JSONB ARRAY" ,
310
+ [
311
+ [
312
+ {
313
+ "test" : ["something" , 123 , "here" ],
314
+ "nested" : ["JSON" ],
315
+ },
316
+ ],
317
+ [
318
+ {
319
+ "test" : ["something" , 123 , "here" ],
320
+ "nested" : ["JSON" ],
321
+ },
322
+ ],
323
+ ],
324
+ [
325
+ [
326
+ {
327
+ "test" : ["something" , 123 , "here" ],
328
+ "nested" : ["JSON" ],
329
+ },
330
+ ],
331
+ [
332
+ {
333
+ "test" : ["something" , 123 , "here" ],
334
+ "nested" : ["JSON" ],
335
+ },
336
+ ],
337
+ ],
338
+ ),
259
339
(
260
340
"JSONB ARRAY" ,
261
341
[
@@ -267,6 +347,17 @@ async def test_as_class(
267
347
[{"array" : "json" }, {"one more" : "test" }],
268
348
],
269
349
),
350
+ (
351
+ "JSONB ARRAY" ,
352
+ [
353
+ PyJSONB ([[{"array" : "json" }], [{"one more" : "test" }]]),
354
+ PyJSONB ([[{"array" : "json" }], [{"one more" : "test" }]]),
355
+ ],
356
+ [
357
+ [[{"array" : "json" }], [{"one more" : "test" }]],
358
+ [[{"array" : "json" }], [{"one more" : "test" }]],
359
+ ],
360
+ ),
270
361
(
271
362
"JSON ARRAY" ,
272
363
[
0 commit comments