Removed None initialization from response#312
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches✨ Simplify code
Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates runware.utils.instantiateDataclass to make response dataclass construction more tolerant of incomplete/empty API payloads, and introduces a compact repr for response dataclasses to reduce noise when debugging.
Changes:
- Add
_compact_dataclass_reprand apply it to dataclasses instantiated viainstantiateDataclass. - Skip
nulland blank-string values from API payloads during dataclass instantiation. - Auto-fill missing required
strfields with""when the payload omits them.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixed
instantiateDataclassnow skipsnulland blank string values from API payloads instead of passing them through as explicitNoneor""instantiateDataclassfills missing requiredstrfields with""when the API leaves them out, so dataclasses likeIModelcan keepversion: strandarchitecture: stras required fieldsChanged
instantiateDataclass/instantiateDataclassList(IModel,IImage,IVideo,I3d, etc.) use a compactreprthat omits unset,None, blank string, and emptyadditional_fieldsvalues