Skip to content

Commit 30e8329

Browse files
review feedback
1 parent 5495f82 commit 30e8329

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

elasticsearch/dsl/_async/document.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343

4444
if TYPE_CHECKING:
4545
from elasticsearch import AsyncElasticsearch
46-
47-
from ...esql.esql import ESQLBase
46+
from elasticsearch.esql.esql import ESQLBase
4847

4948

5049
class AsyncIndexMeta(DocumentMeta):
@@ -561,13 +560,15 @@ async def esql_execute(
561560
# nested fields, which ES|QL does not return, causing an error. When passing
562561
# `ignore_missing_fields=True` the list will be generated with
563562
# `for_esql=True`, so the error will not occur, but the documents will
564-
# not have any nested objects in them.
563+
# not have any Nested objects in them.
565564
doc_fields = set(cls._get_field_names(for_esql=ignore_missing_fields))
566565
if not ignore_missing_fields and not doc_fields.issubset(set(query_columns)):
567566
raise ValueError(
568567
f"Not all fields of {cls.__name__} were returned by the query. "
569568
"Make sure your document does not use Nested fields, which are "
570-
"currently not supported in ES|QL."
569+
"currently not supported in ES|QL. To force the query to be "
570+
"evaluated in spite of the missing fields, pass set the "
571+
"ignore_missing_fields=True option in the esql_execute() call."
571572
)
572573
non_doc_fields: set[str] = set(query_columns) - doc_fields - {"_id"}
573574
index_id = query_columns.index("_id")

elasticsearch/dsl/_sync/document.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343

4444
if TYPE_CHECKING:
4545
from elasticsearch import Elasticsearch
46-
47-
from ...esql.esql import ESQLBase
46+
from elasticsearch.esql.esql import ESQLBase
4847

4948

5049
class IndexMeta(DocumentMeta):
@@ -553,13 +552,15 @@ def esql_execute(
553552
# nested fields, which ES|QL does not return, causing an error. When passing
554553
# `ignore_missing_fields=True` the list will be generated with
555554
# `for_esql=True`, so the error will not occur, but the documents will
556-
# not have any nested objects in them.
555+
# not have any Nested objects in them.
557556
doc_fields = set(cls._get_field_names(for_esql=ignore_missing_fields))
558557
if not ignore_missing_fields and not doc_fields.issubset(set(query_columns)):
559558
raise ValueError(
560559
f"Not all fields of {cls.__name__} were returned by the query. "
561560
"Make sure your document does not use Nested fields, which are "
562-
"currently not supported in ES|QL."
561+
"currently not supported in ES|QL. To force the query to be "
562+
"evaluated in spite of the missing fields, pass set the "
563+
"ignore_missing_fields=True option in the esql_execute() call."
563564
)
564565
non_doc_fields: set[str] = set(query_columns) - doc_fields - {"_id"}
565566
index_id = query_columns.index("_id")

elasticsearch/esql/esql.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,7 @@ class ESQLBase(ABC):
9797
commands, used to build ES|QL queries.
9898
"""
9999

100-
def __init__(
101-
self,
102-
parent: Optional["ESQLBase"] = None,
103-
):
100+
def __init__(self, parent: Optional["ESQLBase"] = None):
104101
self._parent = parent
105102

106103
def __repr__(self) -> str:

elasticsearch/esql/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ def min_over_time(field: ExpressionType) -> InstrumentedExpression:
649649

650650

651651
def multi_match(
652-
query: ExpressionType, *fields: ExpressionType, options: ExpressionType = None
652+
query: ExpressionType, fields: ExpressionType, options: ExpressionType = None
653653
) -> InstrumentedExpression:
654654
"""Use `MULTI_MATCH` to perform a multi-match query on the specified field.
655655
The multi_match query builds on the match query to allow multi-field queries.

0 commit comments

Comments
 (0)