-
Notifications
You must be signed in to change notification settings - Fork 880
fix: enable search for index columns in PandasTableManager #7947
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
| searches columns, not the index. This override resets the index (if needed) | ||
| before searching, making index values searchable. | ||
| """ | ||
| # Check if we need to reset the index (same logic as to_json_str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can probably pull out the logic in to_json_str to shared functions to share more of this code
| data_for_search = data_for_search.reset_index() | ||
|
|
||
| # Create a temporary manager with reset index for searching | ||
| temp_manager = PandasTableManager(data_for_search) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we just return return PandasTableManager(data_for_search).search(query)
| # Default index, use parent search method and convert result back to PandasTableManager | ||
| searched_manager = super().search(query) | ||
| searched_data = searched_manager.data.to_native() | ||
| return PandasTableManager(searched_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think return super().search(query) would be fine
📝 Summary
Closes #7945
This PR enables search functionality for index columns in the PandasTableManager.
🔍 Description of Changes
Currently, the table search logic only scans DataFrame columns. When users call df.value_counts(), the resulting labels are stored in the index, which made them unsearchable.
Changes:
Testing:
📋 Checklist