confluentinc / confluentinc/confluent-kafka-python
Add AggregateSerializer, AggregateDeserializer
- 主要言語
- Python
- スター
- 509
- フォーク
- 964
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 14
説明
Description
===========
I had to write a class like the `AggregateSerializer` below recently. It seems like something that would naturally be in the library given producers can produce to multiple topics and considers can subscribe to multiple topics (each with its own format).
See #838
See #1009
How to implement
================
In `/src/confluent_kafka/serialization/__init__.py`, two classes could be added:
```python
class AggregateSerializer(Serializer):
def __init__(self, serializers: Dict[str, Serializer]):
self.serializers = serializers
def __call__(self, obj, ctx: SerializationContext):
return self.serializers[ctx.topic](obj. ctx)
# And basically the same for AggregateDeserializer
```
And basically the same for `AggregateDeserializer`, plus doc comments per other classes in module.
I can do the legwork to integrate this if it increases the chances of it getting in.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
/src/confluent_kafka/serialization/__init__.py から始めて、既存の Serializer クラスと Deserializer クラスを読み、その後 #838 と #1009 のコンテキストを確認します。AggregateSerializer と AggregateDeserializer が ctx.topic 用の handler を選択し、モジュール内の他のクラスと一貫したドキュメントを含んでいれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- distributed-systems
- issue の種類
- 機能追加
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100