Skip to content

Commit 118ff63

Browse files
minor typing updates
1 parent c43c5e3 commit 118ff63

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

elasticsearch_dsl/document_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def __init__(self, name: str, bases: Tuple[type, ...], attrs: Dict[str, Any]):
165165
fields.update(annotations.keys())
166166
field_defaults = {}
167167
for name in fields:
168-
value = None
168+
value: Any = None
169169
required = None
170170
multi = None
171171
if name in annotations:
@@ -201,7 +201,7 @@ def __init__(self, name: str, bases: Tuple[type, ...], attrs: Dict[str, Any]):
201201
field_args = [type_]
202202
elif type_ in self.type_annotation_map:
203203
# use best field type for the type hint provided
204-
field, field_kwargs = self.type_annotation_map[type_]
204+
field, field_kwargs = self.type_annotation_map[type_] # type: ignore
205205

206206
if field:
207207
field_kwargs = {

utils/generator.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,6 @@ def add_not_set(type_):
9999
return type_
100100

101101

102-
# def add_optional(type_):
103-
# """Add Optional to a Python type hint."""
104-
# if type_.startswith("Union["):
105-
# type_ = f"{type_[:-1]}, None]"
106-
# else:
107-
# type_ = f"Union[{type_}, None]"
108-
# return type_
109-
110-
111102
class ElasticsearchSchema:
112103
"""Operations related to the Elasticsearch schema."""
113104

utils/templates/response.__init__.py.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class AggResponse(AttrDict[Any], Generic[_R]):
193193

194194

195195
class UpdateByQueryResponse(AttrDict[Any], Generic[_R]):
196-
"""An Elasticsearch response.
196+
"""An Elasticsearch update by query response.
197197

198198
{% for arg in ubq_response.args %}
199199
{% for line in arg.doc %}

0 commit comments

Comments
 (0)