{"record":{"id":"18bbd9a0bb5530bd","repo":"microsoft/graphrag","slug":"reports-missing-source-col-column","errorCode":null,"errorMessage":"Reports missing {source_col} column","messagePattern":"Reports missing (.+?) column","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag/graphrag/query/indexer_adapters.py","lineNumber":209,"sourceCode":"        entities_col=None,\n        relationships_col=None,\n        covariates_col=None,\n        parent_col=\"parent\",\n        children_col=\"children\",\n        attributes_cols=None,\n    )\n\n\ndef embed_community_reports(\n    reports_df: pd.DataFrame,\n    embedder: \"LLMEmbedding\",\n    source_col: str = \"full_content\",\n    embedding_col: str = \"full_content_embedding\",\n) -> pd.DataFrame:\n    \"\"\"Embed a source column of the reports dataframe using the given embedder.\"\"\"\n    if source_col not in reports_df.columns:\n        error_msg = f\"Reports missing {source_col} column\"\n        raise ValueError(error_msg)\n\n    if embedding_col not in reports_df.columns:\n        reports_df[embedding_col] = reports_df.loc[:, source_col].apply(\n            lambda x: embedder.embedding(input=[x]).first_embedding\n        )\n\n    return reports_df\n\n\ndef _filter_under_community_level(\n    df: pd.DataFrame, community_level: int\n) -> pd.DataFrame:\n    return cast(\n        \"pd.DataFrame\",\n        df[df.level <= community_level],\n    )\n","sourceCodeStart":191,"sourceCodeEnd":226,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag/graphrag/query/indexer_adapters.py#L191-L226","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect reports_df.columns and confirm 'full_content' exists before embedding","Pass the correct source_col matching an existing column (e.g. 'summary' if that's what you embed)","Regenerate/switch to a reports table that includes full_content (standard create_community_reports output)"],"exampleFix":"# before\nembedded = embed_community_reports(reports_df, embedder)  # no full_content col\n# after\nif 'full_content' not in reports_df.columns:\n    reports_df['full_content'] = reports_df['summary']\nembedded = embed_community_reports(reports_df, embedder)","handlingStrategy":"validation","validationCode":"src = source_col if source_col in reports_df.columns else 'full_content'\nassert src in reports_df.columns, f'reports df lacks {src}'\nembedded = embed_community_reports(reports_df, embedder, source_col=src)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check df.columns before embedding steps","Pin the GraphRAG version used to produce and to read index artifacts"],"tags":["graphrag","dataframe","schema","embedding"],"backgroundTag":"missing-dataframe-column","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}