Fix merge() method to return MicroDataFrame - #261
Merged
Conversation
- Implement merge() method that returns MicroDataFrame instead of DataFrame - Add drop() method with full inplace support - Preserve weights correctly during merge operations - Fixes issue where merge() would lose MicroDataFrame functionality 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Implement __getattr__ to allow df.column_name syntax (Fixes #220) - Update changelog to reference all fixed issues - This addresses user request for more intuitive column access 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Implement nullify_weights() to set all weights to 1 (Fixes #176) - Useful for comparing weighted and unweighted statistics - Method available on both MicroDataFrame and MicroSeries 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Update aggregation functions to skip non-numeric columns (Fixes #213) - Matches pandas behavior which only aggregates numeric columns - Applies to scalar, vector, and agnostic functions - Also fixes groupby aggregations to skip non-numeric columns 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Add deprecation warning to set_weight_col() (Fixes #208) - Add test for set_weights() with string column name argument - set_weights() already handles both array and string inputs - Users should use set_weights(column_name) instead of set_weight_col(column_name) 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Add missing _link_all_weights() call when weights is a string - This ensures MicroSeries columns have their weights properly linked - Fixes CI test failure 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive testing instructions to CLAUDE.md - Include common CI failure troubleshooting guide - Run formatter to fix docstring and import issues - Ensure all files end with newlines 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Format microdataframe.py and test_microseries_dataframe.py with black - Update CLAUDE.md to emphasize running `make format` before pushing - This should fix CI linting failures 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Break long strings in deprecation warning and comment - Ensure all lines are under 79 characters - Now passes both `make format` and `make lint` 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
- Update Makefile so `make format` fails if there are long lines black can't fix - This ensures CI lint checks and local development are in sync - Developers must manually break long strings/comments - Update CLAUDE.md to document this behavior Now `make format` and CI lint checks are consistent - both will fail on E501 errors. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses multiple open issues by implementing missing functionality and fixing bugs in MicroDataFrame:
merge()method that properly returns a MicroDataFramedrop()method with full inplace support__getattr__method for intuitive column accessnullify_weights()method to temporarily ignore weightsset_weight_col()methodChanges
drop()method: Required for merge operations, supports all pandas DataFrame.drop() parameters including inplacemerge()method: Overrides pandas merge to return MicroDataFrame with preserved weights__getattr__method: Allows accessing columns as attributes (e.g.,df.column_name)nullify_weights()method: Sets all weights to 1 for both MicroDataFrame and MicroSeriesset_weight_col(): Users should useset_weights(column_name)insteadset_weights()with string column name argumentIssues Fixed
Test plan
🤖 Generated with Claude Code