Skip to content

Cascade graph extraction fails with TypeError due to parameter name mismatch #2556

@YizukiAme

Description

@YizukiAme

Bug Description

extract_graph_from_data() in extract_graph_from_data_v2.py passes ontology_adapter= as a keyword argument to integrate_chunk_graphs(), but the receiving function's signature expects ontology_resolver=:

# extract_graph_from_data_v2.py L59-64
return await integrate_chunk_graphs(
    data_chunks=data_chunks,
    chunk_graphs=chunk_graphs,
    graph_model=KnowledgeGraph,
    ontology_adapter=ontology_adapter,  # ← wrong keyword
)
# extract_graph_from_data.py L56-60
async def integrate_chunk_graphs(
    data_chunks: list[DocumentChunk],
    chunk_graphs: list,
    graph_model: Type[BaseModel],
    ontology_resolver: BaseOntologyResolver,  # ← expected keyword
    ...
    **kwargs,
)

Because integrate_chunk_graphs accepts **kwargs, the mismatched keyword is silently absorbed and ontology_resolver ends up missing — causing a TypeError at runtime on the cascade extraction path.

The same inconsistency exists in get_default_tasks_by_indices.py, where ontology_adapter is passed as a task kwarg instead of going through the config["ontology_config"]["ontology_resolver"] path.

Steps to Reproduce

Call extract_graph_from_data() from extract_graph_from_data_v2 with any ontology resolver → TypeError: integrate_chunk_graphs() missing 1 required positional argument: 'ontology_resolver'.

Expected Behavior

The ontology resolver should be forwarded correctly under the ontology_resolver parameter name.

Environment

  • Branch: dev (commit 452333a)
  • Python 3.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions