Stream.group_by don't support schema

Đang mở
#552 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
18/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
kafka, python
Lĩnh vực
stream-processing

Hướng nghiên cứu

Start from the Stream.group_by call in the reproduction, where the agent's custom schema is lost when the internal topic is created for key grouping. Read how that internal topic gets its deserializer, then check whether a schema passed to group_by would reach it. Done means event.value arrives as the custom record type rather than str in the reproduction; the issue has no linked pull request and no maintainer decision yet, so confirm the design with maintainers first.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Checklist

  • I have included information about relevant versions
  • I have verified that the issue persists when using the master branch of Faust.

Steps to reproduce

I have an agent that uses a custom schema. Also, the agent groups messages by key before processing them.

The issue is due to the internal topic created by the method stream.group_by.
This internal topic doesn't deserialize the message properly.

The solution could be to pass this schema through an argument to the method Stream.group_by.

Expected behavior

async def get_key(value):
        return value.id

@app.agent(schema=CustomSchema())
async def counter(stream):
    """ Count records. """
    async for event in stream.group_by(get_key, name='count').events():
        
        ## the type of event.value should be MyRecord, instead of str
        
        yield event

Actual behavior

This internal topic created by Stream.group_by doesn't deserialize the message properly.

Versions

  • Python version: 3.10
  • Faust version: 0.10.16
Ngôn ngữ chính
Python
Star
1.9k
Fork
205
Merge trung bình
2 giờ 2 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của faust-streaming/faust

Tất cả issue của faust-streaming/faust

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.