Skip to content

feat: Enhance DataFrame query capabilities to support Python expressions #456

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

Merged
merged 1 commit into from
Jul 11, 2025

Conversation

plusplusoneplusplus
Copy link
Owner

Summary

  • Enhanced DataFrame query processor to support Python expressions in addition to existing filter operations
  • Added comprehensive validation and error handling for Python expression evaluation
  • Implemented security controls to prevent execution of dangerous operations
  • Added extensive test coverage for both filter and expression query types

Changes Made

  • mcp_tools/dataframe_service/tool.py: Updated to use new query processor interface
  • utils/dataframe_manager/query/processor.py: Enhanced query processor with Python expression support
  • utils/dataframe_manager/tests/test_query_processor.py: Added comprehensive test coverage

Test Plan

  • All existing filter-based query tests continue to pass
  • New Python expression query tests validate functionality
  • Security validation tests ensure safe expression evaluation
  • Error handling tests for malformed expressions
  • Integration tests with DataFrame service tool

Breaking Changes

None - maintains backward compatibility with existing filter-based queries.

🤖 Generated with Claude Code

- Updated DataFrameServiceTool to allow querying with both pandas query syntax and Python expressions.
- Modified the query method in DataFrameQueryProcessor to handle fallback from pandas query to Python eval, improving flexibility.
- Enhanced metadata tracking to indicate the method used for querying (pandas or Python).
- Added comprehensive tests to validate the new functionality and ensure correct behavior for various query scenarios.

This enhancement broadens the querying capabilities, making it easier for users to perform complex data manipulations.
@plusplusoneplusplus plusplusoneplusplus enabled auto-merge (squash) July 11, 2025 06:22
@plusplusoneplusplus plusplusoneplusplus merged commit eb5bde7 into main Jul 11, 2025
12 checks passed
@plusplusoneplusplus plusplusoneplusplus deleted the feat/dataframe-python-expressions branch July 11, 2025 06:28
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.

1 participant