Skip to content

Commit c3ac767

Browse files
committed
feat: Implement support for a new Azure Blob connector
- #1957 Summary - Fix: (1e) [Major] Missing `await` on `AsyncOpenSearch.search()` permanently zeroes container ingestion status
1 parent b5c560a commit c3ac767

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • enhancements/connectors/azure_blob

enhancements/connectors/azure_blob/api.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,19 @@ async def azure_blob_container_status(
221221
"aggs": {"doc_ids": {"terms": {"field": "document_id", "size": 50000}}},
222222
}
223223
index_name = get_index_name()
224-
os_resp = opensearch_client.search(index=index_name, body=query_body)
224+
os_resp = await opensearch_client.search(index=index_name, body=query_body)
225225
for bucket_entry in os_resp.get("aggregations", {}).get("doc_ids", {}).get("buckets", []):
226226
doc_id = bucket_entry["key"]
227227
if "::" in doc_id:
228228
container_name = doc_id.split("::")[0]
229229
ingested_counts[container_name] = ingested_counts.get(container_name, 0) + 1
230230
except Exception:
231-
pass # OpenSearch unavailable — show zero counts
231+
logger.warning(
232+
"Failed to aggregate Azure Blob ingestion counts for connection %s; "
233+
"container status will show zero counts",
234+
connection_id,
235+
exc_info=True,
236+
) # OpenSearch unavailable / query failed — show zero counts
232237

233238
result = [
234239
{

0 commit comments

Comments
 (0)