Accumulate without emit/output
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- stream-processing
Hướng nghiên cứu
Start with the linked Accumulating State documentation and the accumulate and partition APIs. Reproduce the example using returns_state=True and a conditional emission, then determine whether accumulate supports suppressing output directly. Done means the requested behavior is implemented or the documentation clearly explains the supported approach, with coverage for both emitted and suppressed values.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
According to the documentation of accumulate (Accumulating State), it is possible to not have accumulate "output" anything:
One piece of data comes in, either one or zero pieces go out.
I tried to come up with a way to use this to "group" values together: collect values as they come in and emit a list "every now and then".
Basically I have something along the lines of this now:
stream = streamz.Stream()
grouped = stream.accumulate(my_group, returns_state=True, start={}).filter(non_empty)
def my_group(state, row):
...
if <condition>:
return state, [<collected_rows>]
else:
return state, None
def non_empty(row):
if row:
return True
return False
But I think the .filter(non_empty) part should not be necessary. I should be able to not return (output) a value unless I emit a list in my_group, no? Would that not be the "zero pieces go out" case?
Note: I realised in the meantime that I might be able to achieve what I need using partition, but the question remains (for other use cases): how can I not emit (or output) a value from accumulate?
- Ngôn ngữ chính
- Python
- Star
- 1.3k
- Fork
- 149
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của python-streamz/streamz
-
pkg_resources warning Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
python-streamz/streamz#481 · 4 bình luận ·
-
Combining the streamz.Stream.filenames() and streamz.Stream.from_textfile() using dask scatter? Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
python-streamz/streamz#480 · 2 bình luận ·
-
Compile the code into c++ Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
python-streamz/streamz#479 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
python-streamz/streamz#478 · 6 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 10/100
python-streamz/streamz#476 · 17 bình luận · 2 reaction ·
Tất cả issue của python-streamz/streamz
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
use-agent-os/agent-os#3314 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
BasedHardware/omi#15662 · 1 bình luận ·
-
documentation help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
AiursoftWeb/AnduinOS-2#19 ·