Skip to content

Commit 9eeeab7

Browse files
committed
Remove unnecessary override code
1 parent 4068c6c commit 9eeeab7

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

elasticsearch/helpers/vectorstore/_async/vectorstore.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ def __init__(
8383
# client.options preserves existing (non-user-agent) headers.
8484
client = client.options(headers={"User-Agent": user_agent})
8585

86-
if hasattr(retrieval_strategy, "text_field"):
86+
if hasattr(retrieval_strategy, "text_field") and retrieval_strategy.text_field is None:
8787
retrieval_strategy.text_field = text_field
88-
if hasattr(retrieval_strategy, "vector_field"):
89-
retrieval_strategy.vector_field = vector_field
9088

9189
self.client = client
9290
self.index = index

elasticsearch/helpers/vectorstore/_sync/vectorstore.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,8 @@ def __init__(
8080
# client.options preserves existing (non-user-agent) headers.
8181
client = client.options(headers={"User-Agent": user_agent})
8282

83-
if hasattr(retrieval_strategy, "text_field"):
83+
if hasattr(retrieval_strategy, "text_field") and retrieval_strategy.text_field is None:
8484
retrieval_strategy.text_field = text_field
85-
if hasattr(retrieval_strategy, "vector_field"):
86-
retrieval_strategy.vector_field = vector_field
8785

8886
self.client = client
8987
self.index = index

0 commit comments

Comments
 (0)