Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move populate_by_name to Event model #357

Merged

Conversation

johannaengland
Copy link
Contributor

Scope and purpose

Inspired by a meeting about Pydantic aliases today. That way not every model using aliases needs to explicitly declare it.

Reference to what populate_by_name does: https://docs.pydantic.dev/latest/api/config/#pydantic.config.ConfigDict.populate_by_name

Related to #338, #335 and #352.

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to Zino can be found in the
README.

  • Added a changelog fragment for towncrier
    • just internal changes
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with black, ruff and isort, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done

That way not every model using aliases needs to explicitely declare it
@johannaengland johannaengland self-assigned this Aug 21, 2024
Copy link

sonarcloud bot commented Aug 21, 2024

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.57%. Comparing base (419305a) to head (99d266a).
Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #357      +/-   ##
==========================================
- Coverage   98.57%   98.57%   -0.00%     
==========================================
  Files          77       77              
  Lines        9701     9699       -2     
==========================================
- Hits         9562     9560       -2     
  Misses        139      139              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@johannaengland johannaengland merged commit c0c5696 into Uninett:master Aug 22, 2024
9 of 10 checks passed
@johannaengland johannaengland deleted the pydantic/populate-by-name branch August 22, 2024 08:20
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.

2 participants