@@ -78,9 +78,9 @@ def _test_img_equals_int32_pyarray(
78
78
assert pixel [ix ] == arr_pixel_tuple [elt ]
79
79
80
80
81
- fl_uint8_4_type = nanoarrow .fixed_size_list (value_type = nanoarrow . uint8 ( nullable = False ),
82
- list_size = 4 ,
83
- nullable = False )
81
+ fl_uint8_4_type = nanoarrow .fixed_size_list (
82
+ value_type = nanoarrow . uint8 ( nullable = False ), list_size = 4 , nullable = False
83
+ )
84
84
85
85
86
86
@pytest .mark .parametrize (
@@ -190,7 +190,9 @@ class DataShape(NamedTuple):
190
190
)
191
191
192
192
193
- @pytest .mark .xfail (reason = "Support for nested array creation is not available in nanoarrow/python" )
193
+ @pytest .mark .xfail (
194
+ reason = "Support for nested array creation is not available in nanoarrow/python"
195
+ )
194
196
@pytest .mark .parametrize (
195
197
"mode, data_tp, mask" ,
196
198
(
@@ -219,10 +221,14 @@ def test_fromarray(mode: str, data_tp: DataShape, mask: list[int] | None) -> Non
219
221
# Apparently there's no good way to create this array from python using nanoarrow
220
222
# https://github.com/apache/arrow-nanoarrow/issues/620
221
223
# the following lines will fail.
222
- tmp_arr = nanoarrow .c_array (elt * (ct_pixels * elts_per_pixel ), schema = nanoarrow .uint8 ())
224
+ tmp_arr = nanoarrow .c_array (
225
+ elt * (ct_pixels * elts_per_pixel ), schema = nanoarrow .uint8 ()
226
+ )
223
227
arr = nanoarrow .Array (tmp_arr , schema = dtype )
224
228
else :
225
- arr = nanoarrow .Array (nanoarrow .c_array ([elt ] * (ct_pixels * elts_per_pixel ), schema = dtype ))
229
+ arr = nanoarrow .Array (
230
+ nanoarrow .c_array ([elt ] * (ct_pixels * elts_per_pixel ), schema = dtype )
231
+ )
226
232
img = Image .fromarrow (arr , mode , TEST_IMAGE_SIZE )
227
233
228
234
_test_img_equals_pyarray (img , arr , mask , elts_per_pixel )
@@ -249,7 +255,9 @@ def test_from_int32array(mode: str, data_tp: DataShape, mask: list[int] | None)
249
255
(dtype , elt , elts_per_pixel ) = data_tp
250
256
251
257
ct_pixels = TEST_IMAGE_SIZE [0 ] * TEST_IMAGE_SIZE [1 ]
252
- arr = nanoarrow .Array (nanoarrow .c_array ([elt ] * (ct_pixels * elts_per_pixel ), schema = dtype ))
258
+ arr = nanoarrow .Array (
259
+ nanoarrow .c_array ([elt ] * (ct_pixels * elts_per_pixel ), schema = dtype )
260
+ )
253
261
img = Image .fromarrow (arr , mode , TEST_IMAGE_SIZE )
254
262
255
263
_test_img_equals_int32_pyarray (img , arr , mask , elts_per_pixel )
@@ -275,7 +283,9 @@ def test_image_nested_metadata(mode: str, metadata: list[str]) -> None:
275
283
assert arr .schema .value_type .metadata
276
284
assert arr .schema .value_type .metadata [b"image" ]
277
285
278
- parsed_metadata = json .loads (arr .schema .value_type .metadata [b"image" ].decode ("utf8" ))
286
+ parsed_metadata = json .loads (
287
+ arr .schema .value_type .metadata [b"image" ].decode ("utf8" )
288
+ )
279
289
280
290
assert "bands" in parsed_metadata
281
291
assert parsed_metadata ["bands" ] == metadata
0 commit comments