lidavidm commented on a change in pull request #10641:
URL: https://github.com/apache/arrow/pull/10641#discussion_r662438080
##########
File path: python/pyarrow/tests/test_compute.py
##########
@@ -137,14 +137,17 @@ def test_option_class_equality():
pytest.fail(f"Options class is not tested: {cls}")
for option in options:
assert option == option
- assert repr(option)
+ assert repr(option).startswith(option.__class__.__name__)
buf = option.serialize()
deserialized = pc.FunctionOptions.deserialize(buf)
assert option == deserialized
assert repr(option) == repr(deserialized)
for option1, option2 in zip(options, options[1:]):
assert option1 != option2
+ assert repr(pc.IndexOptions(pa.scalar(1))) == "IndexOptions{value=int64:1}"
+ assert repr(pc.ArraySortOptions()) == "ArraySortOptions{order=Ascending}"
Review comment:
Would `<>` be more typical for Python? We can slice in __repr__ here and
replace with our own braces.
For C++, you can generally use either parens or curly braces. But the only
reason why curly braces are used here is because that's what
Expression::ToString did before the refactor, and I assume there it's so things
would print like `cast(..., {...})` instead of `cast(..., (...))`, i.e. to not
nest parentheses too much.
--
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]