Skip to content

Commit 4ddff36

Browse files
committed
spellcheck and ci fixes
1 parent 297373b commit 4ddff36

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

graphrag/index/storage/cosmosdb_pipeline_storage.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(
4646
else:
4747
if cosmosdb_account_url is None:
4848
msg = (
49-
"Either connection_string or cosmosdb_accoun_url must be provided."
49+
"Either connection_string or cosmosdb_account_url must be provided."
5050
)
5151
raise ValueError(msg)
5252

@@ -210,10 +210,14 @@ async def set(self, key: str, value: Any, encoding: str | None = None) -> None:
210210
value_json = value_df.to_json(
211211
orient="records", lines=False, force_ascii=False
212212
)
213-
cosmos_db_item = {"id": key, "body": json.loads(value_json)}
213+
if value_json is None:
214+
log.exception("Error converting output %s to json", key)
215+
else:
216+
cosmos_db_item = {"id": key, "body": json.loads(value_json)}
217+
container_client.upsert_item(body=cosmos_db_item)
214218
else:
215219
cosmos_db_item = {"id": key, "body": json.loads(value)}
216-
container_client.upsert_item(body=cosmos_db_item)
220+
container_client.upsert_item(body=cosmos_db_item)
217221
except Exception:
218222
log.exception("Error writing item %s", key)
219223

0 commit comments

Comments
 (0)