microsoft/graphrag · error · ValueError

Reports missing {source_col} column

Error message

Reports missing {source_col} column

What it means

read_indexer_reports/embed_community_reports requires the community reports dataframe to contain the source column being embedded (default 'full_content'). If that column is absent — e.g. reports were loaded without content or a custom source_col was passed — the ValueError fires before embedding starts.

Source

Thrown at packages/graphrag/graphrag/query/indexer_adapters.py:209

        entities_col=None,
        relationships_col=None,
        covariates_col=None,
        parent_col="parent",
        children_col="children",
        attributes_cols=None,
    )


def embed_community_reports(
    reports_df: pd.DataFrame,
    embedder: "LLMEmbedding",
    source_col: str = "full_content",
    embedding_col: str = "full_content_embedding",
) -> pd.DataFrame:
    """Embed a source column of the reports dataframe using the given embedder."""
    if source_col not in reports_df.columns:
        error_msg = f"Reports missing {source_col} column"
        raise ValueError(error_msg)

    if embedding_col not in reports_df.columns:
        reports_df[embedding_col] = reports_df.loc[:, source_col].apply(
            lambda x: embedder.embedding(input=[x]).first_embedding
        )

    return reports_df


def _filter_under_community_level(
    df: pd.DataFrame, community_level: int
) -> pd.DataFrame:
    return cast(
        "pd.DataFrame",
        df[df.level <= community_level],
    )

View on GitHub (pinned to f40e9a26ce)

Solutions

  1. Inspect reports_df.columns and confirm 'full_content' exists before embedding
  2. Pass the correct source_col matching an existing column (e.g. 'summary' if that's what you embed)
  3. Regenerate/switch to a reports table that includes full_content (standard create_community_reports output)

Example fix

# before
embedded = embed_community_reports(reports_df, embedder)  # no full_content col
# after
if 'full_content' not in reports_df.columns:
    reports_df['full_content'] = reports_df['summary']
embedded = embed_community_reports(reports_df, embedder)
Defensive patterns

Strategy: validation

Validate before calling

src = source_col if source_col in reports_df.columns else 'full_content'
assert src in reports_df.columns, f'reports df lacks {src}'
embedded = embed_community_reports(reports_df, embedder, source_col=src)

Prevention

When it happens

Trigger: Calling embed_community_reports(reports_df, embedder) on a dataframe missing the 'full_content' column; passing source_col='summary' when the df only has other columns; using create_community_reports output that dropped content fields.

Common situations: Loading a parquet of community reports produced by a different GraphRAG version with renamed columns; selecting a subset of columns before embedding; custom report generation that omits full_content.

Related errors


AI-assisted analysis of microsoft/graphrag@f40e9a26ce (2026-08-27). Data as JSON: /api/errors/18bbd9a0bb5530bd. Report an issue: GitHub.