Skip to content

Count combiner does not work as expected #1

@anwarfg

Description

@anwarfg

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Currently takes two floats, rather than a SumPartial. This deviates from the expected behaviour of the sum combiner.

Expected Behavior

The count combiner does not behave like the sum combiner. An issue in some examples has led me to find that the count combiner takes floats and adds them, rather than taking a sumPartial and returning the count.

This line:
count_combiner = Combiner[float, float](finalise=lambda x: x)

should probably be
count_combiner = Combiner[SumPartial, float](finalise=lambda x: x.count)

This would retain the same structure as the sum_combiner, and be used in a similar way.

Steps To Reproduce

No response

Environment

- OS:
- Other environment details:

I'm part of a Project Team

No response

Anything else?

No response

Are you willing to contribute to resolve this issue?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    🚦 triageThis newly added item needs triaging

    Type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions