From 261c8af78513b7a0873f95acedb437a3cefc5e09 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Tue, 23 Apr 2024 10:39:16 +0330 Subject: [PATCH] fix: linter issues! --- bot/retrievers/custom_retriever.py | 4 ++-- tests/unit/test_base_engine.py | 1 - utils/query_engine/__init__.py | 2 +- utils/query_engine/base_engine.py | 1 - utils/query_engine/github.py | 6 +++--- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/bot/retrievers/custom_retriever.py b/bot/retrievers/custom_retriever.py index deac4ac..bb05ec0 100644 --- a/bot/retrievers/custom_retriever.py +++ b/bot/retrievers/custom_retriever.py @@ -1,5 +1,6 @@ """ -We're going to override the `_build_node_list_from_query_result` since it is raising errors having the llama-index legacy & newer version together +We're going to override the `_build_node_list_from_query_result` +since it is raising errors having the llama-index legacy & newer version together """ from llama_index.core.data_structs.data_structs import IndexDict @@ -12,7 +13,6 @@ class CustomVectorStoreRetriever(VectorIndexRetriever): - def _build_node_list_from_query_result( self, query_result: VectorStoreQueryResult ) -> list[NodeWithScore]: diff --git a/tests/unit/test_base_engine.py b/tests/unit/test_base_engine.py index f08119f..09820a6 100644 --- a/tests/unit/test_base_engine.py +++ b/tests/unit/test_base_engine.py @@ -4,7 +4,6 @@ class TestBaseEngine(TestCase): - def test_setup_vector_store_index(self): """ Tests that _setup_vector_store_index creates a PGVectorAccess object diff --git a/utils/query_engine/__init__.py b/utils/query_engine/__init__.py index ea544ac..ce734c4 100644 --- a/utils/query_engine/__init__.py +++ b/utils/query_engine/__init__.py @@ -1,4 +1,4 @@ # flake8: noqa +from .github import GitHubQueryEngine from .prepare_discord_query_engine import prepare_discord_engine_auto_filter from .subquery_gen_prompt import DEFAULT_GUIDANCE_SUB_QUESTION_PROMPT_TMPL -from .github import GitHubQueryEngine diff --git a/utils/query_engine/base_engine.py b/utils/query_engine/base_engine.py index ed59008..72bda45 100644 --- a/utils/query_engine/base_engine.py +++ b/utils/query_engine/base_engine.py @@ -4,7 +4,6 @@ class BaseEngine: - @classmethod def _setup_vector_store_index( cls, diff --git a/utils/query_engine/github.py b/utils/query_engine/github.py index e9822e8..b5adf61 100644 --- a/utils/query_engine/github.py +++ b/utils/query_engine/github.py @@ -1,8 +1,8 @@ -from utils.query_engine.base_engine import BaseEngine -from llama_index.core.query_engine import RetrieverQueryEngine from bot.retrievers.custom_retriever import CustomVectorStoreRetriever -from llama_index.core import get_response_synthesizer from bot.retrievers.utils.load_hyperparams import load_hyperparams +from llama_index.core import get_response_synthesizer +from llama_index.core.query_engine import RetrieverQueryEngine +from utils.query_engine.base_engine import BaseEngine class GitHubQueryEngine(BaseEngine):