Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#316 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
ドキュメント
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python

調査の方向性

まず、pydantic v3で提案されている変更を念頭に置き、scanspec、FastCS、pvi、ibek、blueapiで使用されているタグ付きユニオンのアプローチを比較します。プロジェクト間で共通のBaseModelアプローチに合意し、その方法と関連するトレードオフがここに文書化されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Jinja
スター
25
フォーク
10
平均マージ
4日 17時間
マージ済み PR(30日)
7

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DiamondLightSource/python-copier-template のほかの issue

DiamondLightSource/python-copier-template の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。