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

simplify tee_map usage #3

Open
MainRo opened this issue Oct 22, 2020 · 0 comments
Open

simplify tee_map usage #3

MainRo opened this issue Oct 22, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@MainRo
Copy link
Member

MainRo commented Oct 22, 2020

tee_map is very flexible, but probably too verbose. For example computing count and sum requires some boilerplate:

tee_map(
    rx.pipe(
        rs.ops.map(lambda i: i.field),
        rs.ops.ops.count(),
    ),
    rx.pipe(
        rs.ops.map(lambda i: i.field),
        rs.ops.math.sum()
    )
)

We should add mappers on the operators to avoid the need of pipe+map on simple aggregates, similar to how this is done on spark:

tee_map(
    rs.ops.ops.count(lambda i: i.field),
    rs.ops.math.sum(lambda i: i.field),
)
@MainRo MainRo added the enhancement New feature or request label Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant