Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting of optional fields with non-string annotations #16

Merged
merged 2 commits into from
Jun 23, 2023

Conversation

mthuurne
Copy link
Member

There were two inconsistencies in the formatting implementation:

  • _collect_type() was only called for annotations in string form, but following code relied on the streamlining applied there
  • _format_value_for_type() could not handle the case where a dataclass was replaced by a specialized Binder

mthuurne added 2 commits June 23, 2023 15:32
This went undetected because the production code only uses postponed
evaluation and the unit tests didn't call `format_template()` with
optional fields.
@mthuurne mthuurne merged commit 5b99dea into main Jun 23, 2023
@mthuurne mthuurne deleted the fix-template-formatting branch June 23, 2023 13:40
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