Compose with collections

Open
#2 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
pandas, python

Research direction

Start by reading the existing local and dask Stream implementations and the issue's proposed BatchStream example. Determine how collection-wise and dataframe streams should compose with both stream types, then document the API boundaries and completion criteria before implementing them.

Written by the indexing model from the issue text.

Description

We probably want a Stream variant that moves around not individual elements, but batches or sequences of elements. We probably also want a Stream variant that moves around Pandas dataframes. Each of these would probably want a different API. Tor example map on a batched stream might look like the following:

class map(BatchStream):
    def __init__(self, func):
        ...
    def update(self, batch):
        new_batch = list(builtins.map(self.func, batch))
        self.emit(new_batch)

However each of these new collection-wise interfaces would probably want to compose with both the lower level local and dask Stream objects.

To that end maybe it makes sense to encapsulate a low-level stream within a user-level stream.

Dominant language
Python
Stars
1.3k
Forks
149
Avg merge
17h 39m
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-streamz/streamz

All issues in python-streamz/streamz

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.