fix(memo): preserve runtime typing for unannotated params#6659
fix(memo): preserve runtime typing for unannotated params#6659harsh21234i wants to merge 7 commits into
Conversation
Greptile SummaryThis PR fixes a regression introduced in 0.9.4 where
Confidence Score: 5/5Safe to merge; the change is narrowly scoped to the first lazy materialization of unannotated memo params and leaves annotated params, function memos, and passthrough/snapshot memos unaffected. The runtime-values dict is correctly gated ( No files require special attention. Important Files Changed
Reviews (7): Last reviewed commit: "Merge branch 'reflex-dev:main' into fix/..." | Re-trigger Greptile |
Merging this PR will not alter performance
Comparing Footnotes
|
|
any update? @masenf |
…r-regression-6631 # Conflicts: # packages/reflex-base/src/reflex_base/components/memo.py
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
Summary
Fixes #6631.
@rx.memocomponent bodies with unannotated parameters were regressing toVar[Any]in 0.9.4, which caused downstreamUntypedVarErrorfailures when the memo bodytried to access object fields or call var methods.
This change preserves the legacy behavior for missing annotations by seeding the memo body with the first call’s runtime value type before the component is
materialized. That keeps the deprecation warning in place, but avoids the confusing compile-time failure for existing call sites.
Testing
uv run pytest -o addopts='' tests/units/components/test_memo.py -q