Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Decide on a pydantic v3 BaseModel tagged union method and document it here

Offen
#316 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Dokumentation
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
python

Rechercherichtung

Beginne damit, die Ansätze für Tagged Unions in scanspec, FastCS, pvi, ibek und blueapi zu vergleichen und dabei die vorgeschlagenen Änderungen in pydantic v3 zu berücksichtigen. Als erledigt gilt die Aufgabe, wenn sich die Projekte auf einen gemeinsamen BaseModel-Ansatz geeinigt haben und diese Methode hier einschließlich der relevanten Abwägungen dokumentiert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

At the moment we have multiple ways of using pydantic and tagged unions:

  • scanspec using pydantic dataclasses and a decorator to make a tagged union of subclasses, it requires positional args
  • FastCS using plain dataclasses and a pydantic BaseModel creation function to do serialization and deserialization
  • pvi uses an explicitly created union of BaseModels
  • ibek uses automatically created Entity BaseModels from EntityModel instances
  • blueapi does 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

Vorherrschende Sprache
Jinja
Sterne
25
Forks
10
Ø Merge
4 T. 17 Std.
Gemergte PRs (30 T.)
7

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus DiamondLightSource/python-copier-template

Alle Issues in DiamondLightSource/python-copier-template

Ähnliche Issues

Weitere Issues zu DevTools

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.