Skip to content

Auto-generated: Helix Compilation Error in nested_for_loops #425

@github-actions

Description

@github-actions

Automatic Error Report

Error Type: Helix Compilation
Test: nested_for_loops
Error Hash: ERROR_HASH:F+xPmvsNa9lb

Query

QUERY loaddocs_rag(chapters: [{ id: I64, subchapters: [{ title: String, content: String, chunks: [{chunk: String, vector: [F64]}]}] }]) =>
    FOR {id, subchapters} IN chapters {
        chapter_node <- AddN<Chapter>({ chapter_index: id })
        FOR {title, content, chunks} IN subchapters {
            subchapter_node <- AddN<SubChapter>({ title: title, content: content })
            AddE<Contains>::From(chapter_node)::To(subchapter_node)
            FOR {chunk, vector} IN chunks {
                vec <- AddV<Embedding>(vector)
                AddE<EmbeddingOf>({chunk: chunk})::From(subchapter_node)::To(vec)
            }
        }
    }
    RETURN "Success"

QUERY searchdocs_rag(query: [F64], k: I32) =>
    vecs <- SearchV<Embedding>(query, k)
    subchapters <- vecs::In<EmbeddingOf>
    RETURN subchapters::{title, content}

QUERY edge_node(id: ID) => 
    e <- N<Chapter>::OutE<Contains>
    RETURN e

Schema

N::Chapter {
    chapter_index: I64
}

N::SubChapter {
    title: String,
    content: String
}

E::Contains {
    From: Chapter,
    To: SubChapter,
    Properties: {
    }
}

V::Embedding {
    chunk: String
}

E::EmbeddingOf {
    From: SubChapter,
    To: Embedding,
    Properties: {
        chunk: String
    }
}

Generated Rust Code

Failed to read generated queries.rs

Error Details

❌ HELIX COMPILE FAILED for nested_for_loops
Stderr: 
⢹ Compiling Helix queries
⢺ Compiling Helix queries�[2K
�[1m�[31mcompilation failed!�[0m�[0m

Stdout: 
�[1m�[31merror[E205]�[0m�[0m: type of value `id` does not match field type `I64` for node type `Chapter` (in QUERY named `loaddocs_rag`)
   �[31m┌─�[0m �[1m/tmp/helix_temp_nested_for_loops/queries.hx:3:57�[0m
   �[31m│�[0m 
�[1m�[31m 3�[0m�[0m �[31m│�[0m }
   �[31m│�[0m                                                        �[1m�[31m^^�[0m�[0m
�[1m�[34m--->�[0m�[0m �[1m�[34mhelp�[0m�[0m: �[1m�[34mchange the value type to match the field type defined in the schema�[0m�[0m


�[1m�[31merror[E205]�[0m�[0m: type of value `title` does not match field type `String` for node type `SubChapter` (in QUERY named `loaddocs_rag`)
   �[31m┌─�[0m �[1m/tmp/helix_temp_nested_for_loops/queries.hx:5:59�[0m
   �[31m│�[0m 
�[1m�[31m 5�[0m�[0m �[31m│�[0m N::SubChapter {
   �[31m│�[0m                                                          �[1m�[31m^^^^^�[0m�[0m
�[1m�[34m--->�[0m�[0m �[1m�[34mhelp�[0m�[0m: �[1m�[34mchange the value type to match the field type defined in the schema�[0m�[0m


�[1m�[31merror[E205]�[0m�[0m: type of value `content` does not match field type `String` for node type `SubChapter` (in QUERY named `loaddocs_rag`)
   �[31m┌─�[0m �[1m/tmp/helix_temp_nested_for_loops/queries.hx:5:75�[0m
   �[31m│�[0m 
�[1m�[31m 5�[0m�[0m �[31m│�[0m N::SubChapter {
   �[31m│�[0m                                                                          �[1m�[31m^^^^^^^�[0m�[0m
�[1m�[34m--->�[0m�[0m �[1m�[34mhelp�[0m�[0m: �[1m�[34mchange the value type to match the field type defined in the schema�[0m�[0m



This issue was automatically generated by the hql-tests runner.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions