-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[AIR] Add __repr__
to AIR classes
#27006
Conversation
@@ -209,6 +209,10 @@ def __init__( | |||
self._uri: Optional[str] = uri | |||
self._obj_ref: Optional[ray.ObjectRef] = obj_ref | |||
|
|||
def __repr__(self): |
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.
nice
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)})" |
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.
Added this so the representation isn't too long.
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.
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 |
Signed-off-by: Richard Liaw <[email protected]>
Signed-off-by: Stefan van der Kleij <[email protected]>
Why are these changes needed?
These changes are needed to improve the UX in interactive sessions and Jupyter notebooks.
Related issue number
Checks
scripts/format.sh
to lint the changes in this PR.