Skip to content

Commit 14ac76c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 28c7645 commit 14ac76c

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

Tests/test_nanoarrow.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def _test_img_equals_int32_pyarray(
7878
assert pixel[ix] == arr_pixel_tuple[elt]
7979

8080

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+
)
8484

8585

8686
@pytest.mark.parametrize(
@@ -190,7 +190,9 @@ class DataShape(NamedTuple):
190190
)
191191

192192

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+
)
194196
@pytest.mark.parametrize(
195197
"mode, data_tp, mask",
196198
(
@@ -219,10 +221,14 @@ def test_fromarray(mode: str, data_tp: DataShape, mask: list[int] | None) -> Non
219221
# Apparently there's no good way to create this array from python using nanoarrow
220222
# https://github.com/apache/arrow-nanoarrow/issues/620
221223
# 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+
)
223227
arr = nanoarrow.Array(tmp_arr, schema=dtype)
224228
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+
)
226232
img = Image.fromarrow(arr, mode, TEST_IMAGE_SIZE)
227233

228234
_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)
249255
(dtype, elt, elts_per_pixel) = data_tp
250256

251257
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+
)
253261
img = Image.fromarrow(arr, mode, TEST_IMAGE_SIZE)
254262

255263
_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:
275283
assert arr.schema.value_type.metadata
276284
assert arr.schema.value_type.metadata[b"image"]
277285

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+
)
279289

280290
assert "bands" in parsed_metadata
281291
assert parsed_metadata["bands"] == metadata

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ optional-dependencies.mic = [
5959
optional-dependencies.test-arrow = [
6060
"arro3-compute",
6161
"arro3-core",
62-
"pyarrow",
6362
"nanoarrow",
63+
"pyarrow",
6464
]
6565

6666
optional-dependencies.tests = [

0 commit comments

Comments
 (0)