[help] Add granular help for dict[str, BaseModel] params#787
[help] Add granular help for dict[str, BaseModel] params#787wrongbad wants to merge 2 commits intoBrianPugh:mainfrom
Conversation
|
thanks for the PR! I only had a chance to skim it right now, but I like that the diff is minimal! However, I think this would only work 1 level deep, right? I think we may need it to be recursive. |
|
Do you think the single-level depth is useful enough to merge a first PR, and revisit arbitrary recursion later? |
|
I'll take a look at this tonight; if there's not a straightforward way of having the recursive support, we could merge this as-is as a partial fix. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #787 +/- ##
==========================================
+ Coverage 89.75% 89.80% +0.04%
==========================================
Files 71 71
Lines 8218 8256 +38
Branches 1861 1864 +3
==========================================
+ Hits 7376 7414 +38
Misses 477 477
Partials 365 365
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Extract a recursive _yield_pydantic_help_entries helper that walks
pydantic model fields to generate synthesized help entries. Handles
nested BaseModels, dict[str, BaseModel] (with additional {NAME}
placeholders), Optional[BaseModel] unwrapping, and circular model
references (emitted as leaf entries instead of silently dropped).
Made-with: Cursor
|
I took a stab at recursive support. See the updated test_help for how I interpreted that. The diff in help.py is still within reason. I didn't bother with lists, or immediate nesting ( |
|
sounds good, thanks! sorry about the slow turn around time on this; i've been traveling work, i'm hoping to work on this this weekend. |
#786
What do you think?