6b7e6b44f1
Python Build and Type Check / python-ci (ubuntu-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
gh-pages / build (push) Has been cancelled
Python Publish (pypi) / Upload release to PyPI (push) Has been cancelled
Spellcheck / spellcheck (push) Has been cancelled
36 lines
870 B
Python
36 lines
870 B
Python
# Copyright (c) 2024 Microsoft Corporation.
|
|
# Licensed under the MIT License
|
|
|
|
from graphrag.index.workflows.create_base_text_units import run_workflow
|
|
|
|
from tests.unit.config.utils import get_default_graphrag_config
|
|
|
|
from .util import (
|
|
compare_outputs,
|
|
create_test_context,
|
|
load_test_table,
|
|
)
|
|
|
|
|
|
async def test_create_base_text_units():
|
|
expected = load_test_table("text_units")
|
|
|
|
context = await create_test_context()
|
|
|
|
config = get_default_graphrag_config()
|
|
config.chunking.prepend_metadata = ["title"]
|
|
|
|
await run_workflow(config, context)
|
|
|
|
actual = await context.output_table_provider.read_dataframe("text_units")
|
|
|
|
print("EXPECTED")
|
|
print(expected.columns)
|
|
print(expected)
|
|
|
|
print("ACTUAL")
|
|
print(actual.columns)
|
|
print(actual)
|
|
|
|
compare_outputs(actual, expected, columns=["text", "document_id", "n_tokens"])
|