Skip to content

Commit f514842

Browse files
Merge branch 'main' into feat/add-count-filtering-to-ElasticSearchDocumentStore
2 parents 29a99fc + 04235ab commit f514842

10 files changed

Lines changed: 54 additions & 49 deletions

File tree

integrations/azure_ai_search/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# Changelog
22

3+
## [integrations/azure_ai_search-v3.0.0] - 2026-01-09
4+
5+
6+
### 🧹 Chores
7+
8+
- Make fmt command more forgiving (#2671)
9+
- [**breaking**] Azure_ai_search - drop Python 3.9 and use X|Y typing (#2695)
10+
311
## [integrations/azure_ai_search-v2.3.3] - 2025-12-10
412

513
### 🚀 Features
614

7-
- Adding `update_by_filter()` and `delete_by_filter()` to `AzureAISearchDocument Store` (#2586)
15+
- Adding updated/delete by filter + tests to `AzureAISearchDocument Store` (#2586)
816

917

1018
### 🧪 Testing

integrations/azure_ai_search/pyproject.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@ name = "azure-ai-search-haystack"
77
dynamic = ["version"]
88
description = 'Haystack 2.x Document Store for Azure AI Search'
99
readme = "README.md"
10-
requires-python = ">=3.9"
10+
requires-python = ">=3.10"
1111
license = "Apache-2.0"
1212
keywords = []
1313
authors = [{ name = "deepset", email = "info@deepset.ai" }]
1414
classifiers = [
1515
"License :: OSI Approved :: Apache Software License",
1616
"Development Status :: 4 - Beta",
1717
"Programming Language :: Python",
18-
"Programming Language :: Python :: 3.9",
1918
"Programming Language :: Python :: 3.10",
2019
"Programming Language :: Python :: 3.11",
2120
"Programming Language :: Python :: 3.12",
2221
"Programming Language :: Python :: 3.13",
2322
"Programming Language :: Python :: Implementation :: CPython",
2423
"Programming Language :: Python :: Implementation :: PyPy",
2524
]
26-
dependencies = ["haystack-ai>=2.11.0", "azure-search-documents>=11.5", "azure-identity"]
25+
dependencies = ["haystack-ai>=2.22.0", "azure-search-documents>=11.5", "azure-identity"]
2726

2827
[project.urls]
2928
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/azure_ai_search#readme"
@@ -80,7 +79,6 @@ allow-direct-references = true
8079

8180

8281
[tool.ruff]
83-
target-version = "py39"
8482
line-length = 120
8583

8684
[tool.ruff.lint]
@@ -127,10 +125,6 @@ ignore = [
127125
"PLR0913",
128126
"PLR0915",
129127
]
130-
unfixable = [
131-
# Don't touch unused imports
132-
"F401",
133-
]
134128
exclude = ["example"]
135129

136130
[tool.ruff.lint.isort]

integrations/azure_ai_search/src/haystack_integrations/components/retrievers/azure_ai_search/bm25_retriever.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Optional, Union
1+
from typing import Any
22

33
from haystack import Document, component, default_from_dict, default_to_dict, logging
44
from haystack.document_stores.types import FilterPolicy
@@ -21,9 +21,9 @@ def __init__(
2121
self,
2222
*,
2323
document_store: AzureAISearchDocumentStore,
24-
filters: Optional[dict[str, Any]] = None,
24+
filters: dict[str, Any] | None = None,
2525
top_k: int = 10,
26-
filter_policy: Union[str, FilterPolicy] = FilterPolicy.REPLACE,
26+
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
2727
**kwargs: Any,
2828
):
2929
"""
@@ -97,7 +97,7 @@ def from_dict(cls, data: dict[str, Any]) -> "AzureAISearchBM25Retriever":
9797

9898
@component.output_types(documents=list[Document])
9999
def run(
100-
self, query: str, filters: Optional[dict[str, Any]] = None, top_k: Optional[int] = None
100+
self, query: str, filters: dict[str, Any] | None = None, top_k: int | None = None
101101
) -> dict[str, list[Document]]:
102102
"""Retrieve documents from the AzureAISearchDocumentStore.
103103

integrations/azure_ai_search/src/haystack_integrations/components/retrievers/azure_ai_search/embedding_retriever.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Optional, Union
1+
from typing import Any
22

33
from haystack import Document, component, default_from_dict, default_to_dict, logging
44
from haystack.document_stores.types import FilterPolicy
@@ -21,9 +21,9 @@ def __init__(
2121
self,
2222
*,
2323
document_store: AzureAISearchDocumentStore,
24-
filters: Optional[dict[str, Any]] = None,
24+
filters: dict[str, Any] | None = None,
2525
top_k: int = 10,
26-
filter_policy: Union[str, FilterPolicy] = FilterPolicy.REPLACE,
26+
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
2727
**kwargs: Any,
2828
):
2929
"""
@@ -94,7 +94,7 @@ def from_dict(cls, data: dict[str, Any]) -> "AzureAISearchEmbeddingRetriever":
9494

9595
@component.output_types(documents=list[Document])
9696
def run(
97-
self, query_embedding: list[float], filters: Optional[dict[str, Any]] = None, top_k: Optional[int] = None
97+
self, query_embedding: list[float], filters: dict[str, Any] | None = None, top_k: int | None = None
9898
) -> dict[str, list[Document]]:
9999
"""Retrieve documents from the AzureAISearchDocumentStore.
100100

integrations/azure_ai_search/src/haystack_integrations/components/retrievers/azure_ai_search/hybrid_retriever.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Optional, Union
1+
from typing import Any
22

33
from haystack import Document, component, default_from_dict, default_to_dict, logging
44
from haystack.document_stores.types import FilterPolicy
@@ -21,9 +21,9 @@ def __init__(
2121
self,
2222
*,
2323
document_store: AzureAISearchDocumentStore,
24-
filters: Optional[dict[str, Any]] = None,
24+
filters: dict[str, Any] | None = None,
2525
top_k: int = 10,
26-
filter_policy: Union[str, FilterPolicy] = FilterPolicy.REPLACE,
26+
filter_policy: str | FilterPolicy = FilterPolicy.REPLACE,
2727
**kwargs: Any,
2828
):
2929
"""
@@ -100,8 +100,8 @@ def run(
100100
self,
101101
query: str,
102102
query_embedding: list[float],
103-
filters: Optional[dict[str, Any]] = None,
104-
top_k: Optional[int] = None,
103+
filters: dict[str, Any] | None = None,
104+
top_k: int | None = None,
105105
) -> dict[str, list[Document]]:
106106
"""Retrieve documents from the AzureAISearchDocumentStore.
107107

integrations/azure_ai_search/src/haystack_integrations/document_stores/azure_ai_search/document_store.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import logging as python_logging
66
from datetime import datetime
7-
from typing import Any, Optional, Union
7+
from typing import Any
88

99
from azure.core.credentials import AzureKeyCredential
1010
from azure.core.exceptions import (
@@ -100,8 +100,8 @@ def __init__(
100100
azure_endpoint: Secret = Secret.from_env_var("AZURE_AI_SEARCH_ENDPOINT", strict=True), # noqa: B008
101101
index_name: str = "default",
102102
embedding_dimension: int = 768,
103-
metadata_fields: Optional[dict[str, Union[SearchField, type]]] = None,
104-
vector_search_configuration: Optional[VectorSearch] = None,
103+
metadata_fields: dict[str, SearchField | type] | None = None,
104+
vector_search_configuration: VectorSearch | None = None,
105105
include_search_metadata: bool = False,
106106
**index_creation_kwargs: Any,
107107
):
@@ -148,8 +148,8 @@ def __init__(
148148
149149
For more information on parameters, see the [official Azure AI Search documentation](https://learn.microsoft.com/en-us/azure/search/).
150150
"""
151-
self._client: Optional[SearchClient] = None
152-
self._index_client: Optional[SearchIndexClient] = None
151+
self._client: SearchClient | None = None
152+
self._index_client: SearchIndexClient | None = None
153153
self._index_fields = [] # type: list[Any] # stores all fields in the final schema of index
154154
self._api_key = api_key
155155
self._azure_endpoint = azure_endpoint
@@ -202,7 +202,7 @@ def client(self) -> SearchClient:
202202

203203
@staticmethod
204204
def _normalize_metadata_index_fields(
205-
metadata_fields: Optional[dict[str, Union[SearchField, type]]],
205+
metadata_fields: dict[str, SearchField | type] | None,
206206
) -> dict[str, SearchField]:
207207
"""Create a list of index fields for storing metadata values."""
208208

@@ -516,7 +516,7 @@ def search_documents(self, search_text: str = "*", top_k: int = 10) -> list[Docu
516516
result = self.client.search(search_text=search_text, top=top_k)
517517
return self._convert_search_result_to_documents(list(result))
518518

519-
def filter_documents(self, filters: Optional[dict[str, Any]] = None) -> list[Document]:
519+
def filter_documents(self, filters: dict[str, Any] | None = None) -> list[Document]:
520520
"""
521521
Returns the documents that match the provided filters.
522522
Filters should be given as a dictionary supporting filtering by metadata. For details on
@@ -567,7 +567,7 @@ def _convert_search_result_to_documents(self, azure_docs: list[dict[str, Any]])
567567
documents.append(doc)
568568
return documents
569569

570-
def _index_exists(self, index_name: Optional[str]) -> bool:
570+
def _index_exists(self, index_name: str | None) -> bool:
571571
"""
572572
Check if the index exists in the Azure AI Search service.
573573
@@ -614,7 +614,7 @@ def _embedding_retrieval(
614614
query_embedding: list[float],
615615
*,
616616
top_k: int = 10,
617-
filters: Optional[str] = None,
617+
filters: str | None = None,
618618
**kwargs: Any,
619619
) -> list[Document]:
620620
"""
@@ -648,7 +648,7 @@ def _bm25_retrieval(
648648
self,
649649
query: str,
650650
top_k: int = 10,
651-
filters: Optional[str] = None,
651+
filters: str | None = None,
652652
**kwargs: Any,
653653
) -> list[Document]:
654654
"""
@@ -681,7 +681,7 @@ def _hybrid_retrieval(
681681
query: str,
682682
query_embedding: list[float],
683683
top_k: int = 10,
684-
filters: Optional[str] = None,
684+
filters: str | None = None,
685685
**kwargs: Any,
686686
) -> list[Document]:
687687
"""

integrations/azure_ai_search/tests/test_document_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def _assert_documents_are_equal(received: list[Document], expected: list[Documen
243243
sorted_expected = sorted(expected, key=lambda doc: doc.id)
244244
assert len(sorted_received) == len(sorted_expected)
245245

246-
for received_doc, expected_doc in zip(sorted_received, sorted_expected):
246+
for received_doc, expected_doc in zip(sorted_received, sorted_expected, strict=True):
247247
# Compare all attributes except score
248248
assert received_doc.id == expected_doc.id
249249
assert received_doc.content == expected_doc.content

integrations/cometapi/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## [integrations/cometapi-v2.0.0] - 2026-01-09
4+
5+
### 🧹 Chores
6+
7+
- Remove Readme API CI workflow and configs (#2573)
8+
- Make fmt command more forgiving (#2671)
9+
- [**breaking**] Cometapi - drop Python 3.9 and use X|Y typing (#2697)
10+
11+
312
## [integrations/cometapi-v1.1.0] - 2025-11-26
413

514
### 🚀 Features

integrations/cometapi/pyproject.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "cometapi-haystack"
77
dynamic = ["version"]
88
description = 'Use Comet API with Haystack to build AI applications with 500+ AI models.'
99
readme = "README.md"
10-
requires-python = ">=3.9"
10+
requires-python = ">=3.10"
1111
license = "Apache-2.0"
1212
keywords = []
1313
authors = [
@@ -18,15 +18,14 @@ classifiers = [
1818
"License :: OSI Approved :: Apache Software License",
1919
"Development Status :: 4 - Beta",
2020
"Programming Language :: Python",
21-
"Programming Language :: Python :: 3.9",
2221
"Programming Language :: Python :: 3.10",
2322
"Programming Language :: Python :: 3.11",
2423
"Programming Language :: Python :: 3.12",
2524
"Programming Language :: Python :: 3.13",
2625
"Programming Language :: Python :: Implementation :: CPython",
2726
"Programming Language :: Python :: Implementation :: PyPy",
2827
]
29-
dependencies = ["haystack-ai>=2.13.2",]
28+
dependencies = ["haystack-ai>=2.22.0",]
3029

3130
[project.urls]
3231
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/cometapi#readme"
@@ -85,7 +84,6 @@ module = [
8584
ignore_missing_imports = true
8685

8786
[tool.ruff]
88-
target-version = "py39"
8987
line-length = 120
9088

9189
[tool.ruff.lint]
@@ -138,10 +136,6 @@ ignore = [
138136
# Allow function call argument defaults e.g. `Secret.from_env_var`
139137
"B008",
140138
]
141-
unfixable = [
142-
# Don't touch unused imports
143-
"F401",
144-
]
145139

146140
[tool.ruff.lint.isort]
147141
known-first-party = ["haystack_integrations"]

integrations/cometapi/src/haystack_integrations/components/generators/cometapi/chat/chat_generator.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Optional, Union
1+
from typing import Any
22

33
from haystack.components.generators.chat import OpenAIChatGenerator
44
from haystack.dataclasses import StreamingCallbackT
@@ -34,13 +34,13 @@ def __init__(
3434
*,
3535
api_key: Secret = Secret.from_env_var("COMET_API_KEY"),
3636
model: str = "gpt-5-mini",
37-
streaming_callback: Optional[StreamingCallbackT] = None,
38-
generation_kwargs: Optional[dict[str, Any]] = None,
39-
timeout: Optional[int] = None,
40-
max_retries: Optional[int] = None,
41-
tools: Optional[Union[list[Union[Tool, Toolset]], Toolset]] = None,
37+
streaming_callback: StreamingCallbackT | None = None,
38+
generation_kwargs: dict[str, Any] | None = None,
39+
timeout: int | None = None,
40+
max_retries: int | None = None,
41+
tools: list[Tool | Toolset] | Toolset | None = None,
4242
tools_strict: bool = False,
43-
http_client_kwargs: Optional[dict[str, Any]] = None,
43+
http_client_kwargs: dict[str, Any] | None = None,
4444
):
4545
api_base_url = "https://api.cometapi.com/v1"
4646

0 commit comments

Comments
 (0)