Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AlenkaF committed May 27, 2024
1 parent e8ff13d commit 5d3ecb8
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions python/pyarrow/tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,21 +1088,23 @@ def test_map_from_arrays():
assert result.equals(expected)

# error if null bitmap and offsets with nulls passed
with pytest.raises(pa.ArrowInvalid, match='Ambiguous to specify both validity map and offsets with nulls'):
msg1 = 'Ambiguous to specify both validity map and offsets with nulls'
with pytest.raises(pa.ArrowInvalid, match=msg1):
pa.MapArray.from_arrays(offsets, keys, items, pa.map_(
keys.type,
items.type),
mask=pa.array([False, True, False], type=pa.bool_())
)
keys.type,
items.type),
mask=pa.array([False, True, False], type=pa.bool_())
)

# error if null bitmap passed to sliced offset
msg2 = 'Null bitmap with offsets slice not supported.'
offsets = pa.array(offsets, pa.int32())
with pytest.raises(pa.ArrowNotImplementedError, match='Null bitmap with offsets slice not supported.'):
with pytest.raises(pa.ArrowNotImplementedError, match=msg2):
pa.MapArray.from_arrays(offsets.slice(2), keys, items, pa.map_(
keys.type,
items.type),
mask=pa.array([False, True, False], type=pa.bool_())
)
keys.type,
items.type),
mask=pa.array([False, True, False], type=pa.bool_())
)

# check invalid usage
offsets = [0, 1, 3, 5]
Expand Down

0 comments on commit 5d3ecb8

Please sign in to comment.