jorisvandenbossche commented on code in PR #36162:
URL: https://github.com/apache/arrow/pull/36162#discussion_r1251858303
##########
python/pyarrow/tests/test_convert_builtin.py:
##########
@@ -2457,14 +2457,29 @@ def test_array_from_pylist_offset_overflow():
)
])
def test_array_accepts_pyarrow_scalar(seq, data, scalar_data, value_type):
- if type(seq(scalar_data)) == set:
- pytest.skip("TODO: The elements in the set get reordered.")
expect = pa.array(data, type=value_type)
result = pa.array(seq(scalar_data))
- assert expect.equals(result)
+
+ if type(seq(scalar_data)) == set:
+ try:
+ import pyarrow.compute as pc
+ expect = [expect[a] for a in
pc.array_sort_indices(expect).to_pylist()]
+ result = [result[a] for a in
pc.array_sort_indices(result).to_pylist()]
+ expect == result
+ except pa.lib.ArrowNotImplementedError:
+ set(expect) == set(result)
Review Comment:
I think it's probably good enough to just always use the fallback (or could
also be `sorted(expect.to_pylist()) == sorted(result.to_pylist())` ?)
(that would avoid some of the complexity)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]