Skip to content

Commit ed1b7cb

Browse files
committed
fix type checks
1 parent fd99815 commit ed1b7cb

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

key-value/key-value-aio/src/key_value/aio/stores/elasticsearch/store.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
},
5858
"value": {
5959
"properties": {
60+
# You might think the `string` field should be a text/keyword field
61+
# but this is the recommended mapping for large stringified json
6062
"string": {
6163
"type": "object",
6264
"enabled": False,

key-value/key-value-aio/src/key_value/aio/stores/elasticsearch/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class LessCapableNdjsonSerializer(NdjsonSerializer):
154154
compatibility_mimetype: ClassVar[str] = "application/vnd.elasticsearch+x-ndjson"
155155

156156
def default(self, data: Any) -> Any:
157-
return LessCapableJsonSerializer.default(data=data) # pyright: ignore[reportCallIssue, reportUnknownVariableType]
157+
return LessCapableJsonSerializer.default(self=self, data=data) # pyright: ignore[reportCallIssue, reportUnknownVariableType, reportArgumentType]
158158

159159
@classmethod
160160
def install_serializer(cls, client: AsyncElasticsearch) -> None:

key-value/key-value-sync/src/key_value/sync/code_gen/stores/elasticsearch/store.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939

4040
DEFAULT_INDEX_PREFIX = "kv_store"
4141

42+
# You might think the `string` field should be a text/keyword field
43+
# but this is the recommended mapping for large stringified json
4244
DEFAULT_MAPPING = {
4345
"properties": {
4446
"created_at": {"type": "date"},

key-value/key-value-sync/src/key_value/sync/code_gen/stores/elasticsearch/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class LessCapableNdjsonSerializer(NdjsonSerializer):
142142
compatibility_mimetype: ClassVar[str] = "application/vnd.elasticsearch+x-ndjson"
143143

144144
def default(self, data: Any) -> Any:
145-
return LessCapableJsonSerializer.default(data=data) # pyright: ignore[reportCallIssue, reportUnknownVariableType]
145+
return LessCapableJsonSerializer.default(self=self, data=data) # pyright: ignore[reportCallIssue, reportUnknownVariableType, reportArgumentType]
146146

147147
@classmethod
148148
def install_serializer(cls, client: Elasticsearch) -> None:

0 commit comments

Comments
 (0)