Skip to content

Commit 69ad36e

Browse files
authored
Fix id baseline (#2036)
* Fix all human_readable_id columns to start at 0 * Semver
1 parent 30bdb35 commit 69ad36e

14 files changed

+10
-12
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "patch",
3+
"description": "Fix all human_readable_id fields to be 0-based."
4+
}

graphrag/index/workflows/create_final_documents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def create_final_documents(
6969
).reset_index(drop=True)
7070

7171
rejoined["id"] = rejoined["id"].astype(str)
72-
rejoined["human_readable_id"] = rejoined.index + 1
72+
rejoined["human_readable_id"] = rejoined.index
7373

7474
if "metadata" not in rejoined.columns:
7575
rejoined["metadata"] = pd.Series(dtype="object")

graphrag/index/workflows/create_final_text_units.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def create_final_text_units(
6060
) -> pd.DataFrame:
6161
"""All the steps to transform the text units."""
6262
selected = text_units.loc[:, ["id", "text", "document_ids", "n_tokens"]]
63-
selected["human_readable_id"] = selected.index + 1
63+
selected["human_readable_id"] = selected.index
6464

6565
entity_join = _entities(final_entities)
6666
relationship_join = _relationships(final_relationships)

graphrag/index/workflows/extract_covariates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,6 @@ async def extract_covariates(
8888
)
8989
text_units.drop(columns=["text_unit_id"], inplace=True) # don't pollute the global
9090
covariates["id"] = covariates["covariate_type"].apply(lambda _x: str(uuid4()))
91-
covariates["human_readable_id"] = covariates.index + 1
91+
covariates["human_readable_id"] = covariates.index
9292

9393
return covariates.loc[:, COVARIATES_FINAL_COLUMNS]
-16.5 KB
Binary file not shown.
-113 KB
Binary file not shown.
-1.96 KB
Binary file not shown.

tests/verbs/data/documents.parquet

-1022 Bytes
Binary file not shown.

tests/verbs/data/entities.parquet

-16.1 KB
Binary file not shown.
-23.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)