paleolimbot commented on code in PR #8:
URL: https://github.com/apache/sedona-db/pull/8#discussion_r2316884697
##########
python/sedonadb/python/sedonadb/testing.py:
##########
@@ -183,6 +188,10 @@ def result_to_tuples(self, result, *, wkt_precision=None)
-> List[Tuple[str]]:
# isinstance() does not always work with pyarrow in pytest
if _type_is_geoarrow(col.type):
columns.append(ga.format_wkt(col,
precision=wkt_precision).to_pylist())
+ elif datatype == "binary":
+ binary_lst = col.cast(pa.binary()).to_pylist()
+ # Convert to hex format for comparison e.g
b'0101000000000000000000F03F000000000000F03F',
+ columns.append([b.hex().upper().encode() for b in binary_lst])
Review Comment:
I see! Maybe:
```python
elif pa.types.is_binary(col.type) or pa.types.is_binary_view(col.type) or
pa.types.is_large_binary(col.type):
columns.append([None if b is None else b.hex().upper() for b in
binary_lst])
```
(i.e., use the column type and not an extra argument, handle nulls, and
return a string instead of utf-8 bytes).
--
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]