Skip to content

Conversation

@jmao-denver
Copy link
Contributor

@jmao-denver jmao-denver commented Dec 9, 2025

Note:

  1. no wrapping of the cyclic referencing Expression class or the Literal class, in favor of the native Python types
  2. no wrapping of the Function and Method classes; workaround exists in the form of the class method from_ that takes in a raw string and returns a Filter object

@jmao-denver jmao-denver self-assigned this Dec 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

No docs changes detected for c629e4f

@jmao-denver jmao-denver marked this pull request as ready for review December 10, 2025 18:51
Copy link
Contributor

@cpwright cpwright left a comment

Choose a reason for hiding this comment

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

I think leaving literal out of the API makes perfect sense. I do think that we should think about more general expressions, so we can interact with QST-like things.

raise DHError(e, "failed to create a pattern filter.") from e


def in_(col: str, values: Sequence[Union[bool, int, float, str]]) -> Filter:
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this should be inverted, i.e. a union of the different sequence types? It seems mixing types might be odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was influenced by this test in Java, and that we allow columns of the generic Object type. The fact that we are not as limiting as the inverted version is also a positive.

@jmao-denver jmao-denver requested a review from Copilot December 16, 2025 17:53
Copy link
Contributor

Copilot AI left a 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 completes the wrapping of structured filters in the Core Python API by adding support for comparison operators (eq, ne, lt, le, gt, ge) and the in_ filter. A new ColumnName string subclass is introduced to distinguish column references from literal values in filter expressions. The implementation delegates to Java filter APIs while avoiding wrapping of cyclic Expression and Literal classes in favor of native Python types.

  • Added comparison filter functions (eq, ne, lt, le, gt, ge) with support for both literals and column names
  • Added in_ filter function for membership testing
  • Introduced ColumnName class to differentiate column references from string literals
  • Updated not_ function to use static Java method instead of instance method

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
py/server/deephaven/filters.py Adds comparison and in_ filter functions, introduces ColumnName class, fixes grammar in module docstring, and updates not_ implementation
py/server/tests/test_filters.py Adds comprehensive test coverage for new in_ and comparison filter functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return _FILTER_COMPARISON_MAP[op](j_left, j_right)


def eq(
Copy link
Contributor

Choose a reason for hiding this comment

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

In the client you took care to handle case insensitivity for eq and ne. I think we also had matches and contains available.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

jmao-denver and others added 5 commits January 8, 2026 14:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jmao-denver jmao-denver force-pushed the DH-20658-complete-structured-filter-py branch from f28bd08 to c629e4f Compare January 8, 2026 21:42
@jmao-denver jmao-denver merged commit 0dc84d3 into deephaven:main Jan 8, 2026
24 checks passed
@jmao-denver jmao-denver deleted the DH-20658-complete-structured-filter-py branch January 8, 2026 22:24
@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants