fix: BI-0 raise an error on unknown fields in BEFORE FILTER BY or IGNORE DIMENSIONS#1439
Open
MCPN wants to merge 4 commits intodatalens-tech:mainfrom
Open
fix: BI-0 raise an error on unknown fields in BEFORE FILTER BY or IGNORE DIMENSIONS#1439MCPN wants to merge 4 commits intodatalens-tech:mainfrom
MCPN wants to merge 4 commits intodatalens-tech:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds validation to raise an error when unknown fields are referenced in BEFORE FILTER BY or IGNORE DIMENSIONS clauses, fixing issue #531. The solution introduces a new BFBChecker validator that verifies all field references in these clauses exist in the current field set.
Key Changes
- Added new
BFBCheckervalidator to detect unknown field references in BEFORE FILTER BY clauses - Introduced
UnknownBFBFieldErrorexception type for reporting validation failures - Enhanced LOOKUP function mutation to propagate errors from IGNORE DIMENSIONS clauses
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/dl_formula/dl_formula/validation/bfb.py | Implements new BFBChecker validator class that validates field references in BEFORE FILTER BY clauses |
| lib/dl_formula/dl_formula/core/exc.py | Adds UnknownBFBFieldError exception for reporting unknown field references |
| lib/dl_query_processing/dl_query_processing/compilation/formula_compiler.py | Integrates BFBChecker into formula validation pipeline |
| lib/dl_formula/dl_formula_tests/unit/validation/test_bfb.py | Comprehensive test suite covering valid and invalid BEFORE FILTER BY scenarios |
| lib/dl_formula/dl_formula/mutation/lookup.py | Adds error propagation for IGNORE DIMENSIONS with unknown fields |
| lib/dl_api_lib/dl_api_lib_tests/db/data_api/result/complex_queries/test_window_functions.py | Removes xfail marker now that the issue is fixed |
| lib/dl_api_lib/dl_api_lib_tests/db/data_api/result/complex_queries/test_lookup_functions.py | Removes xfail marker and unused pytest import |
| lib/dl_formula/dl_formula/validation/window.py | Removes unused import |
| lib/dl_formula/dl_formula/validation/aggregation.py | Removes unused import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
da5f070 to
60b2b18
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Closes #531
Long time no see 😁