-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-13236: [Python] Include options class name in repr #10641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
python/pyarrow/tests/test_compute.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you test the actual repr for one or two classes somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some assertions at the bottom of the test.
python/pyarrow/tests/test_compute.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, for Python it might be nice to use (..) instead of {..} (do the curly braces make more sense for C++? Also there instantiating the class uses round brackets?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
() would be more typical, but here the representation isn't roundtrippable anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer Seems like it has been updated already.(..) as well.
No description provided.