You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The confluent AvroSerializer/AvroDeserializer classes require both a schema as well as an object to_dict and from_dict to object function. Using the following code I can successfully use the avro_schema, asdict and parse_obj functions from the generated code from this library to fill those requirements:
However its still a bit clunky as the functions do not exactly match. Espescially the current implementation of the to_dict is close but not exactly usable as it does not fill the standardize_factory as above.
Note that successful integration is key to usage of these models in combination with an enterprise setting that relies of a schema-registry and confluents avro encoding header to support schema evolution across different implementation languages.
Describe the solution you'd like
I'd like the generated classes to come with class-level methods matching the provided lambdas, or if that is not feasible at least include the standardize_factory=standardize_custom_type) in the call to asdict from the object's to_dict by default.
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered:
Note that successful integration is key to usage of these models in combination with an enterprise setting that relies of a schema-registry and confluents avro encoding header to support schema evolution across different implementation languages.
I agree but in this case the confluent python ecosystem is not stable at all so I would not go to far in the integration. However, I think we can include standardize_factory: Optional[Callable[..., Any] = None in the to_dict method . PR is welcome.
PS: Documentation and examples would be also nice to have.
Is your feature request related to a problem? Please describe.
The confluent AvroSerializer/AvroDeserializer classes require both a
schema
as well as an objectto_dict
andfrom_dict
to object function. Using the following code I can successfully use theavro_schema
,asdict
andparse_obj
functions from the generated code from this library to fill those requirements:However its still a bit clunky as the functions do not exactly match. Espescially the current implementation of the
to_dict
is close but not exactly usable as it does not fill the standardize_factory as above.Note that successful integration is key to usage of these models in combination with an enterprise setting that relies of a schema-registry and confluents avro encoding header to support schema evolution across different implementation languages.
Describe the solution you'd like
I'd like the generated classes to come with class-level methods matching the provided lambdas, or if that is not feasible at least include the
standardize_factory=standardize_custom_type)
in the call toasdict
from the object's to_dict by default.Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: