Skip to content

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

Merged
mthuurne merged 2 commits into
mainfrom
fix-template-formatting
Jun 23, 2023
Merged

Fix formatting of optional fields with non-string annotations#16
mthuurne merged 2 commits into
mainfrom
fix-template-formatting

Conversation

@mthuurne

Copy link
Copy Markdown
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