Skip to content

Conversation

@kczimm
Copy link
Author

kczimm commented Aug 21, 2025

After adding #87, I get this test error:

failures:

---- dataframe::filtered_aggr_with_param_values stdout ----
Error: SchemaError(FieldNotFound { field: Column { relation: Some(Bare { table: "table1" }), name: "c2" }, valid_fields: [Column { relation: None, name: "count(table1.c2) FILTER (WHERE table1.c3 > $1)" }] }, Some(""))


failures:
    dataframe::filtered_aggr_with_param_values

UPSTREAM NOTE: This has not been submitted upstream yet.
@kczimm kczimm force-pushed the kczimm/prep-spiceai-48 branch from 8b42c31 to 90cd47f Compare August 21, 2025 21:33
@kczimm
Copy link
Author

kczimm commented Aug 21, 2025

Fixed and amended commit. Moving on to cherry picking #88

@kczimm
Copy link
Author

kczimm commented Aug 21, 2025

After adding #88 and resolving merge conflicts, I get this test error:

Error: Context("Can not find type of table1.c3 needed to infer placeholder type", SchemaError(FieldNotFound { field: Column { relation: Some(Bare { table: "table1" }), name: "c3" }, valid_fields: [Column { relation: None, name: "count(table1.c2) FILTER (WHERE table1.c3 > $1)" }] }, Some("")))
test dataframe::filtered_aggr_with_param_values ... FAILED

failures:

failures:
    dataframe::filtered_aggr_with_param_values

which is similar to before

…pes based on their expression (#88)

UPSTREAM NOTE: This has not been submitted upstream yet.
@kczimm kczimm force-pushed the kczimm/prep-spiceai-48 branch from 3797c45 to 7a95436 Compare August 22, 2025 16:01
@kczimm
Copy link
Author

kczimm commented Aug 22, 2025

Had to modify this new function to fix the broken test. I'm not 100% confident in it but tests pass now:

fn find_first_non_null_data_type_expr_placeholder<'a>(
    exprs: impl Iterator<Item = &'a Expr>,
    schema: &DFSchema,
) -> Result<DataType> {
    let mut failed_expr = None;
    for expr in exprs {
        let data_type = match expr.get_type(schema) {
            Ok(dt) => dt,
            Err(e) => {
                failed_expr = Some((expr, e));
                continue;
            }
        };
        if data_type != DataType::Null {
            return Ok(data_type);
        }
    }

    if let Some((expr, e)) = failed_expr {
        return Err(e.context(format!(
            "Can not find type of {expr} needed to infer placeholder type"
        )));
    }

    Ok(DataType::Null)
}
image

@kczimm kczimm requested a review from sgrebnov August 22, 2025 16:03
@kczimm kczimm self-assigned this Aug 22, 2025
@kczimm kczimm marked this pull request as ready for review August 22, 2025 16:04
@kczimm kczimm merged commit eb10a12 into spiceai-48-old Aug 22, 2025
@kczimm kczimm deleted the kczimm/prep-spiceai-48 branch August 22, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants