Skip to content

Commit dadffb8

Browse files
Dict -> dict in codegen
1 parent 0c52f2c commit dadffb8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

replit_river/codegen/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def extract_props(tpe: RiverType) -> list[dict[str, RiverType]]:
333333
type.patternProperties["^(.*)$"], prefix, base_model
334334
)
335335
typeddict_encoder.append(f"encode_{type_name}(x)")
336-
return (f"Dict[str, {type_name}]", type_chunks)
336+
return (f"dict[str, {type_name}]", type_chunks)
337337
assert type.type == "object", type.type
338338

339339
current_chunks: list[str] = [f"class {prefix}({base_model}):"]
@@ -491,7 +491,6 @@ def generate_river_client_module(
491491
import datetime
492492
from typing import (
493493
Any,
494-
Dict,
495494
Literal,
496495
Optional,
497496
Mapping,

replit_river/codegen/server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ def message_encoder(
155155
chunks = [
156156
f"def _{m.name}Encoder(",
157157
f" e: {module_name}_pb2.{m.name}",
158-
") -> Dict[str, Any]:",
159-
" d: Dict[str, Any] = {}",
158+
") -> dict[str, Any]:",
159+
" d: dict[str, Any] = {}",
160160
]
161161
# Non-oneof fields.
162162
oneofs: DefaultDict[int, list[descriptor_pb2.FieldDescriptorProto]] = (
@@ -230,7 +230,7 @@ def generate_river_module(
230230
f"""\
231231
# Code generated by river.codegen. DO NOT EDIT.
232232
import datetime
233-
from typing import Any, Dict, Mapping, Tuple
233+
from typing import Any, Mapping, Tuple
234234
235235
from google.protobuf import timestamp_pb2
236236
from google.protobuf.wrappers_pb2 import BoolValue

0 commit comments

Comments
 (0)