feat: add load_attrs_dict() utility function#53
Conversation
|
Would it be better just to have a load_attrs_dict instead of an arg? |
|
I would also in general recommend using Props.read_from over load_dict. It already has this functionality as well as being able to apply our cascade logic and pathvar substitution. In general I think it should be the preferred way to o this metadata reads |
|
uhm Toby does this really reduce the amount of code? in the end you can just do I think it would be better to just implement |
|
Sure also an ok solution
…________________________________
From: Luigi Pertoldi ***@***.***>
Sent: Tuesday, April 7, 2026 10:59 AM
To: gipert/dbetto ***@***.***>
Cc: Toby Dixon ***@***.***>; Author ***@***.***>
Subject: Re: [gipert/dbetto] Modify load_dict to accept as_attrs_dict parameter (PR #53)
⚠ Caution: External sender
[https://avatars.githubusercontent.com/u/20358192?s=20&v=4]gipert left a comment (gipert/dbetto#53)<#53 (comment)>
uhm Toby does this really reduce the amount of code? in the end you can just do AttrsDict(load_dict(...)).
I think it would be better to just implement load_attrs_dict() instead of adding a new arg?
—
Reply to this email directly, view it on GitHub<#53 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANSET43OYTEO4AIOKETM3HL4US7P3AVCNFSM6AAAAACXM2U2KOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCOJXG44DAOBWHE>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #53 +/- ##
==========================================
- Coverage 91.77% 91.72% -0.05%
==========================================
Files 6 6
Lines 547 568 +21
==========================================
+ Hits 502 521 +19
- Misses 45 47 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add
load_attrs_dict()as a standalone utility function that loads a JSON or YAML file directly as anAttrsDict, rather than modifyingload_dict()with an extra argument. Both functions are now exported from the top-leveldbettonamespace.