Skip to content

Commit

Permalink
Fix missing clone overrides on derived aggregations(#6898)
Browse files Browse the repository at this point in the history
Fixes #6891 

Adds missing `clone()` overrides on aggregations that are derived but do not use `derived_aggregation`.

Authors:
  - Jason Lowe <[email protected]>

Approvers:
  - Mark Harris
  - MithunR
  - Alessandro Bellina

URL: #6898
  • Loading branch information
jlowe authored Dec 4, 2020
1 parent 1af9bc0 commit e22c3ae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
- PR #6869 Avoid dependency resolution failure in latest version of pip by explicitly specifying versions for dask and distributed
- PR #6806 Force install of local conda artifacts
- PR #6887 Fix typo and `0-d` numpy array handling in binary operation
- PR #6898 Fix missing clone overrides on derived aggregations
- PR #6899 Update JNI to new gather boundary check API


Expand Down
15 changes: 15 additions & 0 deletions cpp/include/cudf/detail/aggregation/aggregation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ struct min_aggregation final : aggregation {
return {this->kind};
}
void finalize(aggregation_finalizer& finalizer) override { finalizer.visit(*this); }

std::unique_ptr<aggregation> clone() const override
{
return std::make_unique<min_aggregation>(*this);
}
};

/**
Expand All @@ -77,6 +82,11 @@ struct max_aggregation final : aggregation {
return {this->kind};
}
void finalize(aggregation_finalizer& finalizer) override { finalizer.visit(*this); }

std::unique_ptr<aggregation> clone() const override
{
return std::make_unique<max_aggregation>(*this);
}
};

/**
Expand Down Expand Up @@ -173,6 +183,11 @@ struct mean_aggregation final : aggregation {
return {aggregation::SUM, aggregation::COUNT_VALID};
}
void finalize(aggregation_finalizer& finalizer) override { finalizer.visit(*this); }

std::unique_ptr<aggregation> clone() const override
{
return std::make_unique<mean_aggregation>(*this);
}
};

/**
Expand Down

0 comments on commit e22c3ae

Please sign in to comment.