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

[RLlib] Make Connectorpipeline indexable #28202

Merged

Conversation

ArturNiederfahrenhorst
Copy link
Contributor

Signed-off-by: Artur Niederfahrenhorst [email protected]

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

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • 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 :(

Signed-off-by: Artur Niederfahrenhorst <[email protected]>
@ArturNiederfahrenhorst ArturNiederfahrenhorst changed the title initial [RLlib] Make Connectorpipeline indexable Aug 31, 2022
Copy link
Member

@gjoliver gjoliver left a 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.

results.append(c)

if len(results) == 0:
raise IndexError
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it!

Signed-off-by: Artur Niederfahrenhorst <[email protected]>
Signed-off-by: Artur Niederfahrenhorst <[email protected]>
results.append(c)

if len(results) == 0:
raise []
Copy link
Member

Choose a reason for hiding this comment

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

return []?

Copy link
Contributor Author

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 <[email protected]>
Copy link
Contributor

@sven1977 sven1977 left a 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 !

@sven1977 sven1977 merged commit 7f03368 into ray-project:master Sep 12, 2022
ilee300a pushed a commit to ilee300a/ray that referenced this pull request Sep 12, 2022
justinvyu pushed a commit to justinvyu/ray that referenced this pull request Sep 14, 2022
@ArturNiederfahrenhorst ArturNiederfahrenhorst deleted the ConnectorPipelineget branch September 21, 2022 10:22
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.

3 participants