Decide on a pydantic v3 BaseModel tagged union method and document it here
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Documentation
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- developer-experience, documentation
Research direction
Start by comparing the tagged-union approaches used by scanspec, FastCS, pvi, ibek, and blueapi, with the proposed pydantic v3 changes in mind. Done means the projects have an agreed common BaseModel approach and that method is documented here, including the relevant trade-offs.
Written by the indexing model from the issue text.
Description
At the moment we have multiple ways of using pydantic and tagged unions:
scanspecusing pydantic dataclasses and a decorator to make a tagged union of subclasses, it requires positional argsFastCSusing plain dataclasses and a pydantic BaseModel creation function to do serialization and deserializationpviuses an explicitly created union of BaseModelsibekuses automatically created Entity BaseModels from EntityModel instancesblueapidoes something with BaseModels too, but I can't remember what
With the advent of pydantic v3, now would be a good time to look at investigating a common approach for all these usecases. Standardising on BaseModel instances would probably give us the most tool support for things like documenting models in sphinx, FastAPI and GraphQL support, and downstream serialization
@GDYendell @gilesknap @DiamondJoseph @tpoliaw @abbiemery FYI
@hyperrealist I'm hoping you'll take this on at some point in the new year
- Dominant language
- Jinja
- Stars
- 28
- Forks
- 10
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 4
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DiamondLightSource/python-copier-template
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Ignore renovate updates for ubuntu and ubuntu-devcontainerPossibly taken @KayMohh claimed this 30 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
documentation good first issue
Difficulty 1/5 Under an hour Newbie friendliness 70/100
All issues in DiamondLightSource/python-copier-template
Similar issues
-
formatter-markdown: keep a bare URL followed by a period linked when emphasis delimiters changeOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
swc-project/swc-next-issues#1167 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tangentcode/tangentswarm#167 ·
Maintainers usually reply within 1 day
-
priority:low ready-for-dev
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
OpenHands/extensions#1015 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ardia-browser/ardia#5763 ·
Maintainers usually reply within 1 day