Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
masci committed Aug 25, 2023
1 parent 8d8b42e commit eec2670
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/example_store/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# SPDX-FileCopyrightText: 2023-present John Doe <jd@example.com>
#
# SPDX-License-Identifier: Apache-2.0
from .document_store import ExampleDocumentStore
from example_store.document_store import ExampleDocumentStore

__all__ = ["ExampleDocumentStore"]
12 changes: 6 additions & 6 deletions src/example_store/document_store.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# SPDX-FileCopyrightText: 2023-present John Doe <jd@example.com>
#
# SPDX-License-Identifier: Apache-2.0
from typing import Any, Dict, List, Optional

import logging
from typing import Any, Dict, List, Optional

from haystack.preview.document_stores.decorator import document_store
from haystack.preview.dataclasses import Document
from haystack.preview.document_stores.protocols import DuplicatePolicy
from haystack.preview.document_stores.decorator import document_store
from haystack.preview.document_stores.errors import DuplicateDocumentError, MissingDocumentError
from haystack.preview.document_stores.protocols import DuplicatePolicy

logger = logging.getLogger(__name__)

Expand All @@ -33,7 +32,7 @@ def count_documents(self) -> int:
"""
return 0 # FIXME

def filter_documents(self, filters: Optional[Dict[str, Any]] = None) -> List[Document]:
def filter_documents(self, _: Optional[Dict[str, Any]] = None) -> List[Document]:
"""
Returns the documents that match the filters provided.
Expand Down Expand Up @@ -131,4 +130,5 @@ def delete_documents(self, document_ids: List[str]) -> None:
:param object_ids: the object_ids to delete
"""
for doc_id in document_ids: # FIXME
raise MissingDocumentError(f"ID '{doc_id}' not found, cannot delete it.")
msg = f"ID '{doc_id}' not found, cannot delete it."
raise MissingDocumentError(msg)
4 changes: 2 additions & 2 deletions src/example_store/retriever.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2023-present John Doe <jd@example.com>
#
# SPDX-License-Identifier: Apache-2.0
from typing import Dict, Any, Optional
from typing import Any, Dict, Optional

from haystack.preview import component

Expand Down Expand Up @@ -29,7 +29,7 @@ def __init__(self, document_store: ExampleDocumentStore, filters: Optional[Dict[
self.top_k = top_k
self.document_store = document_store

def run(self, data):
def run(self, _):
"""
Run the Retriever on the given input data.
Expand Down

0 comments on commit eec2670

Please sign in to comment.