confluentinc / confluentinc/confluent-kafka-python

Add AggregateSerializer, AggregateDeserializer

Abierto
#1,237 2 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement priority:low status:help-wanted status:waiting-for-interest
Lenguaje dominante
Python
Estrellas
509
Forks
964
Merge medio
1 d 14 h
PR fusionados (30 d)
14

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza en /src/confluent_kafka/serialization/__init__.py y lee las clases Serializer y Deserializer existentes; después revisa el contexto de #838 y #1009. La tarea estará terminada cuando AggregateSerializer y AggregateDeserializer seleccionen el handler para ctx.topic e incluyan documentación coherente con la de las demás clases del módulo.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
distributed-systems
Tipo de issue
Nueva funcionalidad
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.