From 2d805053adbebc49466cda0593f2b2afc835db3b Mon Sep 17 00:00:00 2001 From: Gabriel Nieves Date: Fri, 11 Apr 2025 01:56:17 +0000 Subject: [PATCH] ran linter --- backend/graphrag_app/api/prompt_tuning.py | 1 - backend/graphrag_app/api/query.py | 2 -- backend/graphrag_app/api/query_streaming.py | 1 - backend/graphrag_app/typing/models.py | 1 - backend/graphrag_app/utils/azure_clients.py | 3 +-- backend/graphrag_app/utils/common.py | 9 ++++----- backend/scripts/indexer.py | 1 - 7 files changed, 5 insertions(+), 13 deletions(-) diff --git a/backend/graphrag_app/api/prompt_tuning.py b/backend/graphrag_app/api/prompt_tuning.py index 29e76b9..936c401 100644 --- a/backend/graphrag_app/api/prompt_tuning.py +++ b/backend/graphrag_app/api/prompt_tuning.py @@ -6,7 +6,6 @@ import traceback from pathlib import Path import graphrag.api as api -import yaml from fastapi import ( APIRouter, Depends, diff --git a/backend/graphrag_app/api/query.py b/backend/graphrag_app/api/query.py index 744886f..4cf16a8 100644 --- a/backend/graphrag_app/api/query.py +++ b/backend/graphrag_app/api/query.py @@ -3,7 +3,6 @@ import os import traceback -from pathlib import Path from fastapi import ( APIRouter, @@ -17,7 +16,6 @@ from graphrag.api.query import local_search as graphrag_local_search from graphrag_app.logger.load_logger import load_pipeline_logger from graphrag_app.typing.models import ( - GraphDriftRequest, GraphGlobalRequest, GraphRequest, GraphResponse, diff --git a/backend/graphrag_app/api/query_streaming.py b/backend/graphrag_app/api/query_streaming.py index 35cd8ac..0e34692 100644 --- a/backend/graphrag_app/api/query_streaming.py +++ b/backend/graphrag_app/api/query_streaming.py @@ -4,7 +4,6 @@ import json import os import traceback -from typing import Dict, List from fastapi import ( APIRouter, diff --git a/backend/graphrag_app/typing/models.py b/backend/graphrag_app/typing/models.py index 4fee5dd..f8fb3a3 100644 --- a/backend/graphrag_app/typing/models.py +++ b/backend/graphrag_app/typing/models.py @@ -4,7 +4,6 @@ from io import StringIO from typing import ( Any, - Dict, List, Optional, ) diff --git a/backend/graphrag_app/utils/azure_clients.py b/backend/graphrag_app/utils/azure_clients.py index a3a1c61..d6d92b7 100644 --- a/backend/graphrag_app/utils/azure_clients.py +++ b/backend/graphrag_app/utils/azure_clients.py @@ -2,6 +2,7 @@ # Licensed under the MIT License. import os +from pathlib import PurePosixPath from azure.cosmos import ( ContainerProxy, @@ -11,7 +12,6 @@ from azure.cosmos import ( from azure.identity import DefaultAzureCredential from azure.storage.blob import BlobServiceClient from azure.storage.blob.aio import BlobServiceClient as BlobServiceClientAsync -from pathlib import PurePosixPath ENDPOINT_ERROR_MSG = "Could not find connection string in environment variables" @@ -133,7 +133,6 @@ class AzureClientManager: else: self.storage_account_name = self.storage_account_hostname.split(".")[0] - def get_blob_service_client(self) -> BlobServiceClient: """ Returns the blob service client. diff --git a/backend/graphrag_app/utils/common.py b/backend/graphrag_app/utils/common.py index 2bd9c9f..9b1a95b 100644 --- a/backend/graphrag_app/utils/common.py +++ b/backend/graphrag_app/utils/common.py @@ -9,20 +9,18 @@ import hashlib import os import sys import traceback -from pathlib import Path -from typing import Annotated, Dict, List from io import StringIO -from typing import Annotated, Tuple +from pathlib import Path +from typing import Annotated, Dict, Tuple import pandas as pd from azure.core.exceptions import ResourceNotFoundError from azure.cosmos import ContainerProxy, exceptions from azure.identity import DefaultAzureCredential from azure.storage.blob.aio import ContainerClient -from fastapi import Header, HTTPException +from fastapi import Header, HTTPException, status from graphrag.config.load_config import load_config from graphrag.config.models.graph_rag_config import GraphRagConfig -from fastapi import Header, HTTPException, status from graphrag_app.logger.load_logger import load_pipeline_logger from graphrag_app.typing.models import QueryData @@ -393,6 +391,7 @@ def update_multi_index_context_data( updated_context_data[key] = updated_entry return updated_context_data + async def create_cache(container_client: ContainerClient) -> None: """ Create a file cache (csv). diff --git a/backend/scripts/indexer.py b/backend/scripts/indexer.py index eb3f386..5481428 100644 --- a/backend/scripts/indexer.py +++ b/backend/scripts/indexer.py @@ -12,7 +12,6 @@ from graphrag.callbacks.workflow_callbacks import WorkflowCallbacks # from graphrag.index.create_pipeline_config import create_pipeline_config from graphrag.config.enums import IndexingMethod from graphrag.config.load_config import load_config -from graphrag.config.models.community_reports_config import CommunityReportsConfig from graphrag.config.models.graph_rag_config import GraphRagConfig from graphrag.index.typing.pipeline_run_result import PipelineRunResult from graphrag.index.workflows.factory import PipelineFactory