Skip to content

Commit 3e28e05

Browse files
hugovkradarhere
andauthored
Types and typos
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
1 parent b729f64 commit 3e28e05

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

Tests/test_pyarrow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
TEST_IMAGE_SIZE = (10, 10)
1818

1919

20-
def _test_img_equals_pyarray(img: Image.Image, arr: Any, mask) -> None:
20+
def _test_img_equals_pyarray(
21+
img: Image.Image, arr: Any, mask: list[int] | None
22+
) -> None:
2123
assert img.height * img.width == len(arr)
2224
px = img.load()
2325
assert px is not None
@@ -53,7 +55,7 @@ def _test_img_equals_pyarray(img: Image.Image, arr: Any, mask) -> None:
5355
("HSV", fl_uint8_4_type, [0, 1, 2]),
5456
),
5557
)
56-
def test_to_array(mode: str, dtype: Any, mask: Any) -> None:
58+
def test_to_array(mode: str, dtype: Any, mask: list[int] | None) -> None:
5759
img = hopper(mode)
5860

5961
# Resize to non-square

src/PIL/Image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3330,7 +3330,7 @@ def fromarrow(obj: SupportsArrowArrayInterface, mode, size) -> Image:
33303330
:param obj: Object with an arrow_c_array interface
33313331
:param mode: Image mode.
33323332
:param size: Image size. This must match the storage of the arrow object.
3333-
:returns: An Image Object
3333+
:returns: An Image object
33343334
33353335
Note that according to the Arrow spec, both the producer and the
33363336
consumer should consider the exported array to be immutable, as

src/libImaging/Arrow.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export_imaging_schema(Imaging im, struct ArrowSchema *schema) {
110110
if (retval != 0) {
111111
return retval;
112112
}
113-
// if it's not 1 band, it's an int32 at the moment. 4 unint8 bands.
113+
// if it's not 1 band, it's an int32 at the moment. 4 uint8 bands.
114114
schema->n_children = 1;
115115
schema->children = calloc(1, sizeof(struct ArrowSchema *));
116116
schema->children[0] = (struct ArrowSchema *)calloc(1, sizeof(struct ArrowSchema));
@@ -137,7 +137,7 @@ release_const_array(struct ArrowArray *array) {
137137
array->buffers = NULL;
138138
}
139139
if (array->children) {
140-
// undone -- does arrow release all the children recursively.
140+
// undone -- does arrow release all the children recursively?
141141
for (int i = 0; i < array->n_children; i++) {
142142
if (array->children[i]->release) {
143143
array->children[i]->release(array->children[i]);
@@ -235,7 +235,7 @@ export_fixed_pixel_array(Imaging im, struct ArrowArray *array) {
235235
// assert(array->buffers != NULL);
236236
array->buffers[0] = NULL; // no nulls, null bitmap can be omitted
237237

238-
// if it's not 1 band, it's an int32 at the moment. 4 unint8 bands.
238+
// if it's not 1 band, it's an int32 at the moment. 4 uint8 bands.
239239
array->n_children = 1;
240240
array->children = calloc(1, sizeof(struct ArrowArray *));
241241
if (!array->children) {

0 commit comments

Comments
 (0)