Context
private_beam and private_spark APIs do converstion from (Count/Sum/Mean/Variance)Params dataclasses to AggregateParams directly in transformation code (e.g. Beam Count and Spark Count).
Since it's done twice, it leads to code duplication and possible bugs when one of them is updated and another not. It would be nice to extract this logic in one place.
What to do
- Introduce method
ToAggregateParams in CountParams, SumParams, MeanParams, VarianceParams and PrivacyIdCountParams (all in the file)
- Write tests for them
- Replace in private_beam and private_spark conversion to use these methods.
Context
private_beam and private_spark APIs do converstion from (Count/Sum/Mean/Variance)Params dataclasses to AggregateParams directly in transformation code (e.g. Beam Count and Spark Count).
Since it's done twice, it leads to code duplication and possible bugs when one of them is updated and another not. It would be nice to extract this logic in one place.
What to do
ToAggregateParamsin CountParams, SumParams, MeanParams, VarianceParams and PrivacyIdCountParams (all in the file)