Skip to content

Commit

Permalink
spellcheck and ci fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KennyZhang1 committed Nov 21, 2024
1 parent 297373b commit 4ddff36
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions graphrag/index/storage/cosmosdb_pipeline_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(
else:
if cosmosdb_account_url is None:
msg = (
"Either connection_string or cosmosdb_accoun_url must be provided."
"Either connection_string or cosmosdb_account_url must be provided."
)
raise ValueError(msg)

Expand Down Expand Up @@ -210,10 +210,14 @@ async def set(self, key: str, value: Any, encoding: str | None = None) -> None:
value_json = value_df.to_json(
orient="records", lines=False, force_ascii=False
)
cosmos_db_item = {"id": key, "body": json.loads(value_json)}
if value_json is None:
log.exception("Error converting output %s to json", key)
else:
cosmos_db_item = {"id": key, "body": json.loads(value_json)}
container_client.upsert_item(body=cosmos_db_item)
else:
cosmos_db_item = {"id": key, "body": json.loads(value)}
container_client.upsert_item(body=cosmos_db_item)
container_client.upsert_item(body=cosmos_db_item)
except Exception:
log.exception("Error writing item %s", key)

Expand Down

0 comments on commit 4ddff36

Please sign in to comment.