Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Aggregator class #19

Merged
merged 1 commit into from
Jul 5, 2024
Merged

Add Aggregator class #19

merged 1 commit into from
Jul 5, 2024

Conversation

ecarreras
Copy link
Member

@ecarreras ecarreras commented Jul 5, 2024

Class to help to aggregate values:

data = [{'value': 10}, {'value': 20}, {'value': 30}]
field_definitions = {'value': ['sum', 'avg', 'max', 'min']}
aggregator = Aggregator(data, field_definitions)
results = aggregator.process()

expect(results['value']['sum']).to(equal(60))
expect(results['value']['avg']).to(equal(20))
expect(results['value']['max']).to(equal(30))
expect(results['value']['min']).to(equal(10))

@ecarreras ecarreras self-assigned this Jul 5, 2024
@ecarreras ecarreras added the minor Create a Minor version label Jul 5, 2024
@ecarreras ecarreras merged commit 2d7d264 into main Jul 5, 2024
1 check passed
@ecarreras ecarreras deleted the aggregator branch July 5, 2024 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Create a Minor version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant