Skip to content

Commit 3105115

Browse files
Lint/Format
1 parent 22ebef6 commit 3105115

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

replit_river/codegen/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ def encode_type(
211211
base_model: str,
212212
in_module: list[ModuleName],
213213
) -> Tuple[TypeExpression, list[ModuleName], list[FileContents], set[TypeName]]:
214+
encoder_name: Optional[str] = None # defining this up here to placate mypy
214215
chunks: List[FileContents] = []
215216
if isinstance(type, RiverNotType):
216217
return (TypeName("None"), [], [], set())
@@ -528,7 +529,7 @@ def extract_props(tpe: RiverType) -> list[dict[str, RiverType]]:
528529
# For the encoder path, do we need "x" to be bound?
529530
# lambda x: ... vs lambda _: {}
530531
needs_binding = False
531-
encoder_names: set[TypeName] = set()
532+
encoder_names = set()
532533
if type.properties:
533534
needs_binding = True
534535
typeddict_encoder.append("{")
@@ -537,7 +538,7 @@ def extract_props(tpe: RiverType) -> list[dict[str, RiverType]]:
537538
type_name, _, contents, _ = encode_type(
538539
prop, TypeName(prefix + name.title()), base_model, in_module
539540
)
540-
encoder_name: Optional[str] = None
541+
encoder_name = None
541542
chunks.extend(contents)
542543
if base_model == "TypedDict":
543544
if isinstance(prop, RiverNotType):

tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ async def client(
148148
transport_options: TransportOptions,
149149
no_logging_error: NoErrors,
150150
) -> AsyncGenerator[Client, None]:
151-
152151
async def websocket_uri_factory() -> UriAndMetadata[None]:
153152
return {
154153
"uri": "ws://localhost:8765",

0 commit comments

Comments
 (0)