Skip to content

Conversation

@giograno
Copy link
Member

@giograno giograno commented Nov 12, 2025

While playing with the framework, I did realize that generating the schema from plain classes was not working with from __future__ import annotations, as this import defers the evaluation at runtime and keeps the annotations as strings.

In this PR we use get_type_hints instead of fetching the raw annotations to circumvent the problem.
Added a reproducible test.

Fixes PNX-479

@giograno giograno requested review from bentsku and thrau November 12, 2025 14:33
@giograno giograno self-assigned this Nov 12, 2025
Copy link

@bentsku bentsku left a comment

Choose a reason for hiding this comment

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

LGTM, this looks like a safe change 👍 kudos for spotting it

@giograno giograno merged commit d11e720 into main Nov 12, 2025
6 checks passed
@giograno giograno deleted the type-aliaes branch November 12, 2025 15:12
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.

3 participants