Skip to content

Commit 331f77f

Browse files
committed
fix test
1 parent a576911 commit 331f77f

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

graphrag/index/input/factory.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ async def create_input(
8181
# Collapse the metadata columns into a single JSON object column
8282
result["metadata"] = result[config.metadata].to_dict(orient="records")
8383

84-
# Drop the original metadata columns after collapsing them
85-
result.drop(columns=config.metadata, inplace=True)
8684
return cast("pd.DataFrame", result)
8785

8886
msg = f"Unknown input type {config.file_type}"

graphrag/storage/file_pipeline_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,4 @@ def _create_progress_status(
178178
total_items=num_total,
179179
completed_items=num_loaded + num_filtered,
180180
description=f"{num_loaded} files loaded ({num_filtered} filtered)",
181-
)
181+
)

graphrag/storage/pipeline_storage.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import re
77
from abc import ABCMeta, abstractmethod
88
from collections.abc import Iterator
9+
from datetime import datetime
910
from typing import Any
1011

1112
from graphrag.logger.base import ProgressLogger
@@ -92,3 +93,10 @@ def get_creation_date(self, key: str) -> str:
9293
-------
9394
- output - The creation date for the given key.
9495
"""
96+
97+
98+
def get_timestamp_formatted_with_local_tz(timestamp: datetime) -> str:
99+
"""Get the formatted timestamp with the local time zone."""
100+
creation_time_local = timestamp.astimezone()
101+
102+
return creation_time_local.strftime("%Y-%m-%d %H:%M:%S %z")

tests/integration/storage/test_cosmosdb_storage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ async def test_clear():
109109
finally:
110110
await storage.clear()
111111

112+
112113
async def test_get_creation_date():
113114
storage = CosmosDBPipelineStorage(
114115
connection_string=WELL_KNOWN_COSMOS_CONNECTION_STRING,
677 Bytes
Binary file not shown.

tests/verbs/test_create_final_documents.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def test_create_final_documents():
3737
compare_outputs(actual, expected)
3838

3939

40-
async def test_create_final_documents_with_attribute_columns():
40+
async def test_create_final_documents_with_metadata_column():
4141
expected = load_test_table(workflow_name)
4242

4343
context = await create_test_context(
@@ -61,6 +61,6 @@ async def test_create_final_documents_with_attribute_columns():
6161
compare_outputs(
6262
actual, expected, columns=["id", "human_readable_id", "text", "text_unit_ids"]
6363
)
64-
assert len(actual.columns) == 5
65-
assert "title" not in actual.columns
64+
assert len(actual.columns) == 6
65+
assert "title" in actual.columns
6666
assert "metadata" in actual.columns

0 commit comments

Comments
 (0)