Skip to content

Commit 7f7b668

Browse files
committed
just make the error less bad
1 parent 2241b8d commit 7f7b668

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/replit_river/codegen/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,11 @@ def {_field_name}(
405405
| UnionTypeExpr
406406
| LiteralType
407407
) = other
408-
raise ValueError(f"What does it mean to have {_o2} here?")
408+
raise ValueError(
409+
f"What does it mean to have {
410+
render_type_expr(_o2)
411+
} here?"
412+
)
409413
if permit_unknown_members:
410414
union = _make_open_union_type_expr(any_of)
411415
else:
@@ -497,7 +501,7 @@ def extract_props(tpe: RiverType) -> list[dict[str, RiverType]]:
497501
return (NoneTypeExpr(), [], [], set())
498502
elif type.type == "Date":
499503
typeddict_encoder.append("datetime.datetime")
500-
return (LiteralTypeExpr("datetime.datetime"), [], [], set())
504+
return (LiteralType("datetime.datetime"), [], [], set())
501505
elif type.type == "array" and type.items:
502506
type_name, module_info, type_chunks, encoder_names = encode_type(
503507
type.items,

0 commit comments

Comments
 (0)