Skip to content

Commit 6c714c4

Browse files
committed
fix integ tests failures. Implemented create() to return a sync OpenSearchDataBaseClient object for telemetry operations that run synchronously before the benchmark
Signed-off-by: Michael Oviedo <mikeovi@amazon.com>
1 parent 8d563ca commit 6c714c4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

osbenchmark/database/clients/opensearch/opensearch.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,17 @@ def create_async(self):
622622
return OpenSearchDatabaseClient(opensearch_client)
623623

624624
def create(self):
625-
"""Non-async client is deprecated."""
626-
raise NotImplementedError("Synchronous clients are deprecated. Use create_async() instead.")
625+
"""
626+
Create a synchronous OpenSearch client.
627+
628+
Used for telemetry and pre-benchmark operations.
629+
630+
Returns:
631+
OpenSearchDatabaseClient wrapping a sync opensearchpy client
632+
"""
633+
os_factory = OsClientFactory(self.hosts, self.client_options)
634+
opensearch_client = os_factory.create()
635+
return OpenSearchDatabaseClient(opensearch_client)
627636

628637
def wait_for_rest_layer(self, max_attempts=40):
629638
"""

0 commit comments

Comments
 (0)