Skip to content
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

[AIR] Add __repr__ to AIR classes #27006

Merged
merged 35 commits into from
Jul 27, 2022

Conversation

bveeramani
Copy link
Member

@bveeramani bveeramani commented Jul 26, 2022

Why are these changes needed?

These changes are needed to improve the UX in interactive sessions and Jupyter notebooks.

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@bveeramani bveeramani marked this pull request as ready for review July 26, 2022 17:21
@@ -209,6 +209,10 @@ def __init__(
self._uri: Optional[str] = uri
self._obj_ref: Optional[ray.ObjectRef] = obj_ref

def __repr__(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Comment on lines +101 to +115
default_values = {
"output_column_name": "concat_out",
"include": None,
"exclude": [],
"dtype": None,
"raise_if_missing": False,
}

non_default_arguments = []
for parameter, default_value in default_values.items():
value = getattr(self, parameter)
if value != default_value:
non_default_arguments.append(f"{parameter}={value}")

return f"{self.__class__.__name__}({', '.join(non_default_arguments)})"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this so the representation isn't too long.

ericl
ericl previously requested changes Jul 27, 2022
Copy link
Contributor

@ericl ericl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please leave datasets out of this for now. The changes will cause many last minute conflicts and also we need to make doc updates.

@bveeramani
Copy link
Member Author

Please leave datasets out of this for now. The changes will cause many last minute conflicts and also we need to make doc updates.

Fixed

@richardliaw richardliaw requested a review from ericl July 27, 2022 17:06
Signed-off-by: Richard Liaw <[email protected]>
@richardliaw richardliaw merged commit 66ed41b into ray-project:master Jul 27, 2022
@bveeramani bveeramani deleted the bveeramani/air-repr2 branch July 27, 2022 20:57
bveeramani added a commit to bveeramani/ray that referenced this pull request Aug 4, 2022
matthewdeng pushed a commit that referenced this pull request Aug 5, 2022
Stefan-1313 pushed a commit to Stefan-1313/ray_mod that referenced this pull request Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants