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

Bugfix/935/match pandas behviour when aggregating columns with nans #1450

Conversation

alexowens90
Copy link
Collaborator

Fixes #935

Also addresses two of the bullet points from #1439:

  • AggregationClause::process x2
  • aggregation.cpp all finalize methods

auto out_ptr = reinterpret_cast<RawType*>(col->ptr());
for(auto i = 0u; i < unique_values; ++i, ++in_ptr, ++out_ptr) {
*out_ptr = in_ptr->value_;
for (auto it = column_data.begin<dynamic_schema_tdt>(); it != column_data.end<dynamic_schema_tdt>(); ++it, ++in_ptr) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't hugely mind but snake case type is not the normal pattern. Is there a reason why this diverges?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, will change

@@ -36,6 +36,29 @@ def test_group_on_float_column_with_nans(lmdb_version_store):
assert_frame_equal(expected, received)


# TODO: Add first and last once un-feature flagged
@pytest.mark.parametrize("aggregator", ("sum", "min", "max", "mean", "count"))
def test_aggregate_float_columns_with_nans(lmdb_version_store, aggregator):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test looks correct to me

@alexowens90 alexowens90 merged commit ed42b00 into master Mar 21, 2024
114 checks passed
@alexowens90 alexowens90 deleted the bugfix/935/match-pandas-behviour-when-aggregating-columns-with-nans branch March 21, 2024 15:38
grusev pushed a commit that referenced this pull request Nov 25, 2024
…1450)

Fixes #935 

Also addresses two of the bullet points from #1439:

- AggregationClause::process x2
- aggregation.cpp all finalize methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QueryBuilder Aggregators do not match Pandas for data with NaNs
3 participants