-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[RLlib] Make Connectorpipeline indexable #28202
[RLlib] Make Connectorpipeline indexable #28202
Conversation
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.
very very nice! thanks, just 1 nit.
rllib/connectors/connector.py
Outdated
results.append(c) | ||
|
||
if len(results) == 0: | ||
raise IndexError |
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 we simply return empty [] instead of raising error?
it feels like a common use case for someone to want to check whether a specific connector is configured for current pipeline, if not, create it.
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.
Got it!
bdb9436
to
29ca5b0
Compare
Signed-off-by: Artur Niederfahrenhorst <artur@anyscale.com>
rllib/connectors/connector.py
Outdated
results.append(c) | ||
|
||
if len(results) == 0: | ||
raise [] |
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.
return []?
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.
Wow. Sorry!
Signed-off-by: Artur Niederfahrenhorst <artur@anyscale.com>
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.
LGTM, thanks for the enhancement @ArturNiederfahrenhorst and your review @gjoliver !
…able by int or class (or classname). (ray-project#28202) Signed-off-by: ilee300a <ilee300@anyscale.com>
…able by int or class (or classname). (ray-project#28202)
Signed-off-by: Artur Niederfahrenhorst artur@anyscale.com
Why are these changes needed?
As per Jun's request, connector pipelines should be indexable.
This PR makes it so that they are indexable by class, class name or an integer number.
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.