mirror of https://github.com/buster-so/buster.git
fix: Improve column reference validation in model expression checks
- Update column validation to use model-defined columns instead of dataset columns - Enhance error message to clarify column reference context - Refine validation logic for expression column references
This commit is contained in:
parent
2618166bf8
commit
c27c27a7e8
|
@ -101,11 +101,11 @@ pub async fn validate_model(
|
|||
.collect();
|
||||
|
||||
for expr_col in expr_cols {
|
||||
if !ds_columns.iter().any(|c| c.name == expr_col) {
|
||||
if !columns.iter().any(|(name, _)| *name == expr_col) {
|
||||
result.add_error(ValidationError::expression_error(
|
||||
col_name,
|
||||
expr,
|
||||
&format!("Referenced column '{}' not found", expr_col),
|
||||
&format!("Referenced column '{}' not found in model definition", expr_col),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue