-
Notifications
You must be signed in to change notification settings - Fork 90
feat: DH-19489: Support structured Filters in Core Py client #7486
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
feat: DH-19489: Support structured Filters in Core Py client #7486
Conversation
No docs changes detected for be53c2e |
fd18265 to
bc3ad0b
Compare
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.
Pull request overview
This PR adds support for structured Filter objects in the Deephaven Core Python client, allowing users to construct type-safe table filters programmatically instead of using only string-based filter expressions.
Key changes:
- New
filters.pymodule withFilterabstract base class and concrete implementations for comparison, logical, and pattern-matching operations - Support for datetime types (Python datetime, numpy datetime64, pandas Timestamp) in filter values
- Case-sensitivity control for string comparison operations
- Integration of Filter objects into Table.where() and Query.where() methods
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| py/client/pydeephaven/filters.py | New module implementing Filter classes and factory functions for creating structured filters |
| py/client/tests/test_filters.py | Comprehensive unit and integration tests for the filters module |
| py/client/pydeephaven/_table_ops.py | Added FilterOp class to handle structured Filter objects in table operations |
| py/client/pydeephaven/_table_interface.py | Updated where() method to accept both string and Filter objects |
| py/client/pydeephaven/table.py | Updated Table.where() signature to include Filter types |
| py/client/pydeephaven/query.py | Updated Query.where() signature to include Filter types |
| py/client/setup.py | Added pandas as a required dependency |
| py/client/requirements.txt | Added pandas to requirements |
Comments suppressed due to low confidence (1)
py/client/pydeephaven/filters.py:1
- The FilterOp class is defined in filters.py but should be in _table_ops.py based on the diff context. This appears to be a misplaced code block - the FilterOp class definition shown in the diff for _table_ops.py (lines 356-383) is the correct location.
#
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| from abc import ABC, abstractmethod | ||
| from typing import Sequence, Union | ||
|
|
||
| import numpy as np |
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.
Should we make np and pandas a soft dependency? I think this is just for the time types in a filter? We are very loose with the version, so I don't think it actually is that awful; but we might consider it.
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.
In theory we can make them soft deps, but the code will be quite a bit messier and probably not worth the benefits.
No description provided.