Skip to content

Commit 85b67ed

Browse files
type ignores for pipe syntax in 3.8/3.9
1 parent 0732365 commit 85b67ed

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

elasticsearch_dsl/document_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
)
3434

3535
try:
36-
from types import UnionType
36+
from types import UnionType # type: ignore[attr-defined]
3737
except ImportError:
3838
UnionType = None
3939

elasticsearch_dsl/response/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545

4646
class Response(AttrDict[Any], Generic[_R]):
47-
"""An Elasticsearch response.
47+
"""An Elasticsearch _search response.
4848
4949
:arg took: (required)
5050
:arg timed_out: (required)

tests/_async/test_document.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,13 +790,13 @@ def test_doc_with_pipe_type_hints() -> None:
790790

791791
class BadlyTypedDoc(AsyncDocument):
792792
s: str
793-
f: str | int | None
793+
f: str | int | None # type: ignore[syntax]
794794

795795
class TypedDoc(AsyncDocument):
796796
s: str
797-
f1: str | None
798-
f2: M[int | None]
799-
f3: M[datetime | None]
797+
f1: str | None # type: ignore[syntax]
798+
f2: M[int | None] # type: ignore[syntax]
799+
f3: M[datetime | None] # type: ignore[syntax]
800800

801801
props = TypedDoc._doc_type.mapping.to_dict()["properties"]
802802
assert props == {

tests/_sync/test_document.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,13 +790,13 @@ def test_doc_with_pipe_type_hints() -> None:
790790

791791
class BadlyTypedDoc(Document):
792792
s: str
793-
f: str | int | None
793+
f: str | int | None # type: ignore[syntax]
794794

795795
class TypedDoc(Document):
796796
s: str
797-
f1: str | None
798-
f2: M[int | None]
799-
f3: M[datetime | None]
797+
f1: str | None # type: ignore[syntax]
798+
f2: M[int | None] # type: ignore[syntax]
799+
f3: M[datetime | None] # type: ignore[syntax]
800800

801801
props = TypedDoc._doc_type.mapping.to_dict()["properties"]
802802
assert props == {

utils/templates/response.__init__.py.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ __all__ = ["Response", "AggResponse", "UpdateByQueryResponse", "Hit", "HitMeta"]
4444

4545

4646
class Response(AttrDict[Any], Generic[_R]):
47-
"""An Elasticsearch _search response.
47+
"""An Elasticsearch search response.
4848

4949
{% for arg in response.args %}
5050
{% for line in arg.doc %}

0 commit comments

Comments
 (0)