Skip to content

fix(types): skip ForwardRef resolution for unannotated attribute probes - #6929

Open
benedikt-bartscher wants to merge 5 commits into
reflex-dev:mainfrom
benedikt-bartscher:annotation-probe-guard
Open

fix(types): skip ForwardRef resolution for unannotated attribute probes#6929
benedikt-bartscher wants to merge 5 commits into
reflex-dev:mainfrom
benedikt-bartscher:annotation-probe-guard

Conversation

@benedikt-bartscher

@benedikt-bartscher benedikt-bartscher commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Review in cubic

@greptile-apps

greptile-apps Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR avoids resolving unrelated forward references when probing unannotated attributes.

  • Adds an MRO-aware annotation-name probe with Python 3.14 lazy-annotation support.
  • Gates full type-hint resolution on whether the requested attribute is annotated.
  • Adds regression coverage for unresolved and PEP 649 lazy annotations.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/reflex-base/src/reflex_base/utils/compat.py Adds cached, MRO-wide annotation-name detection without resolving ordinary annotation values.
packages/reflex-base/src/reflex_base/utils/types.py Uses annotation-name detection to avoid unnecessary ForwardRef resolution during attribute probes.
tests/units/test_attribute_access_type.py Covers unannotated probes, unresolved annotated names, and Python 3.14 lazy annotations.

Reviews (5): Last reviewed commit: "Merge branch 'main' into annotation-prob..." | Re-trigger Greptile

Comment thread packages/reflex-base/src/reflex_base/utils/compat.py
@codspeed-hq

codspeed-hq Bot commented Aug 22, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 32 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing benedikt-bartscher:annotation-probe-guard (d87ed2f) with main (8853e14)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@benedikt-bartscher
benedikt-bartscher marked this pull request as ready for review August 22, 2026 12:41
@benedikt-bartscher
benedikt-bartscher requested a review from a team as a code owner August 22, 2026 12:41

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread tests/units/test_attribute_access_type.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant