Skip to content

Extract transformation from Count/Sum/Mean/VarianceParams to AggregateParams #578

@dvadym

Description

@dvadym

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

  1. Introduce method ToAggregateParams in CountParams, SumParams, MeanParams, VarianceParams and PrivacyIdCountParams (all in the file)
  2. Write tests for them
  3. Replace in private_beam and private_spark conversion to use these methods.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Refactor 🔨A complete overhaul of a file, feature, or codebase

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions