[WIP] feat: add ranking expression support for topN and bottomN filters#1490
[WIP] feat: add ranking expression support for topN and bottomN filters#1490AStaroverov wants to merge 2 commits intomainfrom
Conversation
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request lays the groundwork for advanced data filtering by introducing support for ranking expressions. It defines the necessary types and interfaces for window functions, integrates them into the existing query expression system, and provides the conversion logic for Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for topN and bottomN filters by adding a new ranking expression to the query model. The implementation correctly translates these filters into a query expression using a rank function, which is a great addition. The changes are well-structured, and the new ExprRanking interface is clearly documented. I have one suggestion to improve the consistency of the new interface with the existing query model. As this is a work-in-progress, please also remember to update the unit tests for filterSpecToSpecQueryExpr to reflect the new functionality for topN and bottomN filters.
| /** Ascending or descending order */ | ||
| ascending?: boolean; |
There was a problem hiding this comment.
For consistency with other parts of the query model like QuerySort (where ascending is a required property), and to avoid ambiguity about default behavior, it would be better to make the ascending property required here as well. This makes the contract of the ExprRanking interface more explicit. The current implementation for topN/bottomN already provides this property, so it would be a non-breaking change for that use case.
| /** Ascending or descending order */ | |
| ascending?: boolean; | |
| /** If true, order ascending (A-Z, 0-9); if false, descending */ | |
| ascending: boolean; |
9f2d706 to
84e65c5
Compare
No description provided.