Skip to content

Sync dotnet code with upstream Python changes (bb9afeb8..bfd42c1e)#8

Merged
sharpninja merged 3 commits intomainfrom
copilot/sync-dotnet-with-python-changes-again
Mar 5, 2026
Merged

Sync dotnet code with upstream Python changes (bb9afeb8..bfd42c1e)#8
sharpninja merged 3 commits intomainfrom
copilot/sync-dotnet-with-python-changes-again

Conversation

Copy link

Copilot AI commented Mar 5, 2026

Description

Ports Python-side changes from upstream microsoft/graphrag (commits 64c55522 through bb9afeb8) into the dotnet codebase.

Related Issues

Tracks upstream commits: bfd42c1e (phantom entity filtering), bf1034a7/97045b55 (row transformers), 47fae953 (per-workflow stats), ba9169a2 (finalize graph schema).

Proposed Changes

  • GraphUtils.FilterOrphanRelationships — Mirrors Python's filter_orphan_relationships(). Drops relationships whose source/target references a non-existent entity title, preventing broken graph edges from LLM hallucinations.

  • RowTransformers (new) — C# port of row_transformers.py. Static helpers for row-level type coercion during streaming table reads: SafeInt, SafeFloat, CoerceList, plus per-model transform methods (TransformEntityRow, TransformRelationshipRow, etc.).

  • PipelineRunner.DumpStatsAsync — Writes stats.json to output storage after each workflow completes, matching Python's _dump_stats_json() behavior for monitoring/observability.

  • Entity.Frequency / Entity.Degree — New properties matching Python's NODE_FREQUENCY and NODE_DEGREE schema columns used by finalize_entities.

  • Relationship.CombinedDegree — New property matching Python's EDGE_DEGREE schema column used by finalize_relationships.

  • FromDictionary updates — Both Entity and Relationship deserialization now handles the new fields.

Checklist

  • I have tested these changes locally.
  • I have reviewed the code changes.
  • I have updated the documentation (if necessary).
  • I have added appropriate unit tests (if applicable).

Additional Notes

316 tests pass (280 existing + 36 new). Zero build warnings, zero CodeQL alerts. Workflow stub implementations remain unchanged — these changes add the data model and utility infrastructure that the workflow implementations will consume once ported.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits March 5, 2026 18:25
…RowTransformers, per-workflow stats, Entity/Relationship data model updates

Co-authored-by: sharpninja <16146732+sharpninja@users.noreply.github.com>
…l coalescing in RowTransformers

Co-authored-by: sharpninja <16146732+sharpninja@users.noreply.github.com>
Copilot AI changed the title [WIP] Sync dotnet code with python changes since last commit Sync dotnet code with upstream Python changes (bb9afeb8..bfd42c1e) Mar 5, 2026
@sharpninja sharpninja marked this pull request as ready for review March 5, 2026 19:37
Copilot AI review requested due to automatic review settings March 5, 2026 19:37
@sharpninja sharpninja merged commit e10cc85 into main Mar 5, 2026
16 of 23 checks passed
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.

2 participants