Skip to content

Commit 3114c60

Browse files
Useless Code Gen (#160)
Why === The code path deleted does not seem to have any effects. What changed ============ Deleted code gen path Test plan ========= Checked ai-infra b4 and after deletion. code gen result did not change
1 parent 86c6d27 commit 3114c60

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/replit_river/codegen/client.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -514,25 +514,6 @@ def extract_props(tpe: RiverType) -> list[dict[str, RiverType]]:
514514
in_module,
515515
permit_unknown_members=permit_unknown_members,
516516
)
517-
# TODO(dstewart): This structure changed since we were incorrectly leaking
518-
# ListTypeExprs into codegen. This generated code is
519-
# probably wrong.
520-
match type_name:
521-
case ListTypeExpr(inner_type_name):
522-
typeddict_encoder.append(
523-
f"encode_{render_literal_type(inner_type_name)}(x)"
524-
)
525-
case DictTypeExpr(_):
526-
raise ValueError(
527-
"What does it mean to try and encode a dict in this position?"
528-
)
529-
case LiteralTypeExpr(const):
530-
typeddict_encoder.append(repr(const))
531-
case TypeName(value):
532-
typeddict_encoder.append(f"encode_{value}(x)")
533-
case other:
534-
_o1: NoneTypeExpr | OpenUnionTypeExpr | UnionTypeExpr = other
535-
raise ValueError(f"What does it mean to have {_o1} here?")
536517
return (DictTypeExpr(type_name), module_info, type_chunks, encoder_names)
537518
assert type.type == "object", type.type
538519

0 commit comments

Comments
 (0)