-
Notifications
You must be signed in to change notification settings - Fork 164
feat(BA-2847): Add base class for minilang filter and ordering converter implementations #6492
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
Conversation
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 introduces two new abstract base classes for converting minilang expressions to domain-specific objects: BaseMinilangFilterConverter for filter expressions and BaseMinilangOrderParser for order expressions. These base classes provide reusable parsing and conversion logic that can be extended by domain-specific implementations.
- Adds
BaseMinilangFilterConverterto convert minilang filter expressions to structured Filter objects with support for AND/OR logical operations - Adds
BaseMinilangOrderParserto parse order expressions (e.g., "+id,-status") into OrderingOption objects - Introduces two new exception classes:
InvalidParameterandASTParsingFailedfor better error handling
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/ai/backend/manager/repositories/types.py | Adds BaseMinilangFilterConverter and BaseMinilangOrderParser abstract base classes with supporting methods for parsing and converting minilang expressions |
| src/ai/backend/common/exception.py | Adds InvalidParameter and ASTParsingFailed exception classes for parameter validation and AST parsing errors |
| changes/6492.feature.md | Documents the feature addition for the changelog |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
resolves #6429 (BA-2847)
Checklist: (if applicable)
ai.backend.testdocsdirectory