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

Prevent fatal error with aggregate avg on empty group #570

Merged
merged 1 commit into from
Oct 12, 2023

Conversation

stloyd
Copy link
Member

@stloyd stloyd commented Oct 12, 2023

Change Log

Added

Fixed

  • Prevent fatal error with aggregate avg on empty group

Changed

Removed

Deprecated

Security


Description

Error:

PHP Fatal error:  Uncaught DivisionByZeroError: Division by zero in /Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/GroupBy/Aggregator/Average.php:49
Stack trace:
#0 /Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/GroupBy.php(101): Flow\ETL\GroupBy\Aggregator\Average->result()
#1 /Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/Pipeline/GroupByPipeline.php(62): Flow\ETL\GroupBy->result()
#2 /Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/DataFrame.php(582): Flow\ETL\Pipeline\GroupByPipeline->process(Object(Flow\ETL\FlowContext))
#3 /Users/stloyd/Documents/flow/examples/topics/aggregations/power_plant_bar_chart.php(56): Flow\ETL\DataFrame->run()
#4 /Users/stloyd/Documents/flow/examples/run_examples.php(47): include('/Users/stloyd/D...')
#5 {main}
  thrown in /Users/stloyd/Documents/flow/src/core/etl/src/Flow/ETL/GroupBy/Aggregator/Average.php on line 49

@norberttech norberttech enabled auto-merge (squash) October 12, 2023 12:49
@norberttech norberttech merged commit e27682f into flow-php:1.x Oct 12, 2023
16 checks passed
@stloyd stloyd deleted the bug/group-aggr-avg branch October 12, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants