Skip to content

Commit

Permalink
fix unused imports and mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
tstadel committed Nov 30, 2023
1 parent 829a9bb commit 79f1127
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 3 additions & 2 deletions integrations/opensearch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ requires-python = ">=3.8"
license = "Apache-2.0"
keywords = []
authors = [
{ name = "Silvano Cerza", email = "[email protected]" },
{ name = "deepset", email = "[email protected]" },
]
classifiers = [
"Development Status :: 4 - Beta",
Expand Down Expand Up @@ -172,6 +172,7 @@ markers = [
[[tool.mypy.overrides]]
module = [
"haystack.*",
"pytest.*"
"pytest.*",
"opensearchpy.*",
]
ignore_missing_imports = true
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
#
# SPDX-License-Identifier: Apache-2.0
import logging
from typing import Any, Dict, List, Literal, Mapping, Optional, Union
from typing import Any, Dict, List, Mapping, Optional, Union

import numpy as np

from opensearchpy import OpenSearch, Urllib3HttpConnection, RequestsHttpConnection, NotFoundError, RequestError
from opensearchpy.helpers import bulk, scan
from haystack import default_from_dict, default_to_dict
from haystack.dataclasses import Document
from haystack.document_stores import DocumentStoreError, DuplicateDocumentError, DuplicatePolicy, document_store
from haystack.utils.filters import convert
from opensearchpy import OpenSearch
from opensearchpy.helpers import bulk

from opensearch_haystack.filters import _normalize_filters

Expand Down Expand Up @@ -63,7 +62,7 @@ def __init__(
embedding_dim = kwargs.get("embedding_dim", 768)
method = kwargs.get("method", None)

mappings = {
mappings: Dict[str, Any] = {
"properties": {
"embedding": {"type": "knn_vector", "index": True, "dimension": embedding_dim},
"content": {"type": "text"},
Expand Down
2 changes: 1 addition & 1 deletion integrations/opensearch/tests/test_document_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
from unittest.mock import patch

import pytest
from opensearchpy.exceptions import RequestError # type: ignore[import-not-found]
from haystack.dataclasses.document import Document
from haystack.document_stores.errors import DocumentStoreError, DuplicateDocumentError
from haystack.document_stores.protocols import DuplicatePolicy
from haystack.testing.document_store import DocumentStoreBaseTests
from opensearchpy.exceptions import RequestError # type: ignore[import-not-found]

from opensearch_haystack.document_store import OpenSearchDocumentStore

Expand Down

0 comments on commit 79f1127

Please sign in to comment.