weaviate-haystack 2.2.0__tar.gz → 2.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/PKG-INFO +2 -2
  2. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/pyproject.toml +7 -5
  3. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/src/haystack_integrations/components/retrievers/weaviate/bm25_retriever.py +1 -0
  4. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/src/haystack_integrations/components/retrievers/weaviate/embedding_retriever.py +1 -0
  5. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/src/haystack_integrations/document_stores/weaviate/document_store.py +7 -6
  6. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/tests/test_auth.py +5 -4
  7. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/tests/test_bm25_retriever.py +1 -0
  8. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/tests/test_document_store.py +6 -5
  9. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/tests/test_embedding_retriever.py +1 -0
  10. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/.gitignore +0 -0
  11. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/CHANGELOG.md +0 -0
  12. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/LICENSE.txt +0 -0
  13. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/README.md +0 -0
  14. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/docker-compose.yml +0 -0
  15. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/pydoc/config.yml +0 -0
  16. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/src/haystack_integrations/components/retrievers/weaviate/__init__.py +0 -0
  17. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/src/haystack_integrations/document_stores/weaviate/__init__.py +0 -0
  18. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/src/haystack_integrations/document_stores/weaviate/_filters.py +0 -0
  19. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/src/haystack_integrations/document_stores/weaviate/auth.py +0 -0
  20. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/tests/__init__.py +0 -0
  21. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/tests/conftest.py +0 -0
  22. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/tests/test_files/robot1.jpg +0 -0
  23. {weaviate_haystack-2.2.0 → weaviate_haystack-2.2.1}/tests/test_filters.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: weaviate-haystack
3
- Version: 2.2.0
3
+ Version: 2.2.1
4
4
  Summary: An integration of Weaviate vector database with Haystack
5
5
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations
6
6
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/weaviate/README.md
@@ -22,7 +22,7 @@ Requires-Python: >=3.8
22
22
  Requires-Dist: haystack-ai
23
23
  Requires-Dist: haystack-pydoc-tools
24
24
  Requires-Dist: python-dateutil
25
- Requires-Dist: weaviate-client
25
+ Requires-Dist: weaviate-client>=4.0
26
26
  Description-Content-Type: text/markdown
27
27
 
28
28
  # weaviate-haystack
@@ -25,7 +25,7 @@ classifiers = [
25
25
  ]
26
26
  dependencies = [
27
27
  "haystack-ai",
28
- "weaviate-client",
28
+ "weaviate-client>=4.0",
29
29
  "haystack-pydoc-tools",
30
30
  "python-dateutil",
31
31
  ]
@@ -49,10 +49,12 @@ git_describe_command = 'git describe --tags --match="integrations/weaviate-v[0-9
49
49
  [tool.hatch.envs.default]
50
50
  dependencies = ["coverage[toml]>=6.5", "pytest", "pytest-rerunfailures", "ipython"]
51
51
  [tool.hatch.envs.default.scripts]
52
- test = "pytest --reruns 3 --reruns-delay 30 -x {args:tests}"
53
- test-cov = "coverage run -m pytest --reruns 3 --reruns-delay 30 -x {args:tests}"
52
+ test = "pytest {args:tests}"
53
+ test-cov = "coverage run -m pytest {args:tests}"
54
+ test-cov-retry = "test-cov --reruns 3 --reruns-delay 30 -x"
54
55
  cov-report = ["- coverage combine", "coverage report"]
55
56
  cov = ["test-cov", "cov-report"]
57
+ cov-retry = ["test-cov-retry", "cov-report"]
56
58
  docs = ["pydoc-markdown pydoc/config.yml"]
57
59
 
58
60
  [[tool.hatch.envs.all.matrix]]
@@ -63,8 +65,8 @@ detached = true
63
65
  dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
64
66
  [tool.hatch.envs.lint.scripts]
65
67
  typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"
66
- style = ["ruff check {args:.}", "black --check --diff {args:.}"]
67
- fmt = ["black {args:.}", "ruff --fix {args:.}", "style"]
68
+ style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"]
69
+ fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"]
68
70
  all = ["style", "typing"]
69
71
 
70
72
  [tool.black]
@@ -7,6 +7,7 @@ from typing import Any, Dict, List, Optional, Union
7
7
  from haystack import Document, component, default_from_dict, default_to_dict
8
8
  from haystack.document_stores.types import FilterPolicy
9
9
  from haystack.document_stores.types.filter_policy import apply_filter_policy
10
+
10
11
  from haystack_integrations.document_stores.weaviate import WeaviateDocumentStore
11
12
 
12
13
 
@@ -7,6 +7,7 @@ from typing import Any, Dict, List, Optional, Union
7
7
  from haystack import Document, component, default_from_dict, default_to_dict
8
8
  from haystack.document_stores.types import FilterPolicy
9
9
  from haystack.document_stores.types.filter_policy import apply_filter_policy
10
+
10
11
  from haystack_integrations.document_stores.weaviate import WeaviateDocumentStore
11
12
 
12
13
 
@@ -68,7 +68,7 @@ class WeaviateDocumentStore:
68
68
  from haystack_integrations.document_stores.weaviate.auth import AuthApiKey
69
69
  from haystack_integrations.document_stores.weaviate.document_store import WeaviateDocumentStore
70
70
 
71
- os.environ["WEAVIATE_API_KEY"] = "MY_API_KEY
71
+ os.environ["WEAVIATE_API_KEY"] = "MY_API_KEY"
72
72
 
73
73
  document_store = WeaviateDocumentStore(
74
74
  url="rAnD0mD1g1t5.something.weaviate.cloud",
@@ -172,17 +172,18 @@ class WeaviateDocumentStore:
172
172
  if self._client:
173
173
  return self._client
174
174
 
175
- if self._url and self._url.startswith("http") and self._url.endswith(".weaviate.network"):
176
- # We use this utility function instead of using WeaviateClient directly like in other cases
177
- # otherwise we'd have to parse the URL to get some information about the connection.
178
- # This utility function does all that for us.
179
- self._client = weaviate.connect_to_wcs(
175
+ if self._url and self._url.endswith((".weaviate.network", ".weaviate.cloud")):
176
+ # If we detect that the URL is a Weaviate Cloud URL, we use the utility function to connect
177
+ # instead of using WeaviateClient directly like in other cases.
178
+ # Among other things, the utility function takes care of parsing the URL.
179
+ self._client = weaviate.connect_to_weaviate_cloud(
180
180
  self._url,
181
181
  auth_credentials=self._auth_client_secret.resolve_value() if self._auth_client_secret else None,
182
182
  headers=self._additional_headers,
183
183
  additional_config=self._additional_config,
184
184
  )
185
185
  else:
186
+ # Embedded, local Docker deployment or custom connection.
186
187
  # proxies, timeout_config, trust_env are part of additional_config now
187
188
  # startup_period has been removed
188
189
  self._client = weaviate.WeaviateClient(
@@ -2,6 +2,11 @@
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
4
 
5
+ from weaviate.auth import AuthApiKey as WeaviateAuthApiKey
6
+ from weaviate.auth import AuthBearerToken as WeaviateAuthBearerToken
7
+ from weaviate.auth import AuthClientCredentials as WeaviateAuthClientCredentials
8
+ from weaviate.auth import AuthClientPassword as WeaviateAuthClientPassword
9
+
5
10
  from haystack_integrations.document_stores.weaviate.auth import (
6
11
  AuthApiKey,
7
12
  AuthBearerToken,
@@ -9,10 +14,6 @@ from haystack_integrations.document_stores.weaviate.auth import (
9
14
  AuthClientPassword,
10
15
  AuthCredentials,
11
16
  )
12
- from weaviate.auth import AuthApiKey as WeaviateAuthApiKey
13
- from weaviate.auth import AuthBearerToken as WeaviateAuthBearerToken
14
- from weaviate.auth import AuthClientCredentials as WeaviateAuthClientCredentials
15
- from weaviate.auth import AuthClientPassword as WeaviateAuthClientPassword
16
17
 
17
18
 
18
19
  class TestAuthApiKey:
@@ -6,6 +6,7 @@ from unittest.mock import Mock, patch
6
6
 
7
7
  import pytest
8
8
  from haystack.document_stores.types import FilterPolicy
9
+
9
10
  from haystack_integrations.components.retrievers.weaviate import WeaviateBM25Retriever
10
11
  from haystack_integrations.document_stores.weaviate import WeaviateDocumentStore
11
12
 
@@ -22,11 +22,6 @@ from haystack.testing.document_store import (
22
22
  WriteDocumentsTest,
23
23
  )
24
24
  from haystack.utils.auth import Secret
25
- from haystack_integrations.document_stores.weaviate.auth import AuthApiKey
26
- from haystack_integrations.document_stores.weaviate.document_store import (
27
- DOCUMENT_COLLECTION_PROPERTIES,
28
- WeaviateDocumentStore,
29
- )
30
25
  from numpy import array as np_array
31
26
  from numpy import array_equal as np_array_equal
32
27
  from numpy import float32 as np_float32
@@ -41,6 +36,12 @@ from weaviate.embedded import (
41
36
  EmbeddedOptions,
42
37
  )
43
38
 
39
+ from haystack_integrations.document_stores.weaviate.auth import AuthApiKey
40
+ from haystack_integrations.document_stores.weaviate.document_store import (
41
+ DOCUMENT_COLLECTION_PROPERTIES,
42
+ WeaviateDocumentStore,
43
+ )
44
+
44
45
 
45
46
  @patch("haystack_integrations.document_stores.weaviate.document_store.weaviate.WeaviateClient")
46
47
  def test_init_is_lazy(_mock_client):
@@ -6,6 +6,7 @@ from unittest.mock import Mock, patch
6
6
 
7
7
  import pytest
8
8
  from haystack.document_stores.types import FilterPolicy
9
+
9
10
  from haystack_integrations.components.retrievers.weaviate import WeaviateEmbeddingRetriever
10
11
  from haystack_integrations.document_stores.weaviate import WeaviateDocumentStore
11
12