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

Support pipe for dump operator #4176

Closed
wants to merge 3 commits into from

Conversation

bentsherman
Copy link
Member

Makes the dump operator behave like an actual operator (i.e. chainable) by moving it to OperatorImpl.

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@netlify
Copy link

netlify bot commented Aug 10, 2023

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit 05a1ae6
🔍 Latest deploy log https://app.netlify.com/sites/nextflow-docs-staging/deploys/6616dd8dcbde7100070237b7
😎 Deploy Preview https://deploy-preview-4176--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
Copy link
Member

@pditommaso pditommaso left a comment

Choose a reason for hiding this comment

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

Worth adding some unit tests

@bentsherman
Copy link
Member Author

I added a unit test. Strangely, the unit test fails but it works when I run it as a script:

$ cat dump.nf
Channel.of(1, 2, 3) | dump

$ ../launch.sh run dump.nf -dump-channels 
N E X T F L O W  ~  version 23.08.0-edge
Launching `dump.nf` [condescending_torricelli] DSL2 - revision: eac5d3d36c
[DUMP] 1
[DUMP] 2
[DUMP] 3

@pditommaso
Copy link
Member

It's already possible to do

channel.of(1,2,3)
  .dump()
  .map(it -> it*2)
  .view()

What you are tying to fix here?

@bentsherman
Copy link
Member Author

To make the pipe syntax work:

channel.of(1,2,3)
  | dump
  | map(it -> it*2)
  | view

@bentsherman bentsherman changed the title Make dump operator chainable Add support for pipe to dump operator Mar 24, 2024
@bentsherman bentsherman changed the title Add support for pipe to dump operator Support pipe for dump operator Mar 24, 2024
@bentsherman bentsherman requested a review from a team as a code owner April 3, 2024 14:39
@pditommaso
Copy link
Member

Moving to draft since tests fails

@pditommaso pditommaso marked this pull request as draft April 10, 2024 19:08
@bentsherman
Copy link
Member Author

Closing in favor of v2 operator library

@bentsherman bentsherman deleted the make-dump-operator-chainable branch November 12, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants