Skip to content

feat: add load_attrs_dict() utility function#53

Merged
gipert merged 1 commit into
gipert:mainfrom
tdixon97:patch-1
Apr 22, 2026
Merged

feat: add load_attrs_dict() utility function#53
gipert merged 1 commit into
gipert:mainfrom
tdixon97:patch-1

Conversation

@tdixon97
Copy link
Copy Markdown

@tdixon97 tdixon97 commented Apr 4, 2026

Add load_attrs_dict() as a standalone utility function that loads a JSON or YAML file directly as an AttrsDict, rather than modifying load_dict() with an extra argument. Both functions are now exported from the top-level dbetto namespace.

@ggmarshall
Copy link
Copy Markdown
Contributor

Would it be better just to have a load_attrs_dict instead of an arg?

@ggmarshall
Copy link
Copy Markdown
Contributor

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

@gipert
Copy link
Copy Markdown
Owner

gipert commented Apr 7, 2026

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?

@tdixon97
Copy link
Copy Markdown
Author

tdixon97 commented Apr 7, 2026 via email

@gipert gipert marked this pull request as draft April 10, 2026 08:21
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gipert gipert changed the title Modify load_dict to accept as_attrs_dict parameter feat: add load_attrs_dict() utility function Apr 22, 2026
@gipert gipert marked this pull request as ready for review April 22, 2026 12:29
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.72%. Comparing base (09ec900) to head (5b17622).
⚠️ Report is 23 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gipert gipert merged commit c99a392 into gipert:main Apr 22, 2026
12 of 13 checks passed
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.

3 participants