Use pydantic instead of dicts
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
まず、既存の event-content dicts と commit 59136e4 の ArtC イベント実装を調べ、次にイベントの作成方法とデシリアライズ方法を確認する。変更に取りかかる前に、生成される Pydantic モデルとイベントバージョンの互換性がどのように機能すべきかを定義する。完了とは、設計によって旧バージョンのデシリアライズが解決され、dict ベースの使用方法が維持されるか、意図的に変更されることを意味する。
索引モデルが issue の本文から書いたものです。
説明
Description
Instead of just storing the event contents as three anonymous dicts we should use pydantic to allow proper typed instance attributes. I tried it out with the ArtC event in https://github.com/magnusbaeck/eiffel-pythonlib/commit/59136e4188914ec8530ba658cef1b2e64f1ba185. Writing these classes by hand is rather boring so we should explore using github.com/koxudaxi/datamodel-code-generator to generate the code.
Motivation
Typed classes would enable linters and IDEs to help out when writing code that accesses events.
Exemplification
I'd expect any piece of code that creates events would be easier to write. Reasonable people may disagree, but pydantic-based classes can be initialized from a dict so you could continue working with dicts if you prefer (but the syntax would be slightly different so it would break backwards compatibility).
Benefits
See Motivation, above.
Possible Drawbacks
It's not clear how we should deal with different versions of the events. When producing events we can probably just use the latest known version, but what do we do when deserializing events of old versions? They might not be acceptable to the current version of the schema (which is what the pydantic model would contain). Should we version the event classes too, when necessary?
- 主要言語
- Python
- スター
- 8
- フォーク
- 12
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eiffel-community/eiffel-pythonlib のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
eiffel-community/eiffel-pythonlib#44 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
eiffel-community/eiffel-pythonlib#31 · コメント 1 件 ·
-
on-hold
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
eiffel-community/eiffel-pythonlib#28 · コメント 3 件 ·
eiffel-community/eiffel-pythonlib の issue をすべて見る
似ている issue
-
tunneld on Windows: Wi-Fi devices are not discovered because uvicorn runs on a ProactorEventLoopオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
doronz88/pymobiledevice3#2051 ·
メンテナーはふだん 1 日以内に返信
-
Remove Datacircleオープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
collabnix/awesome-mcp-lists#230 ·
メンテナーはふだん 9 日以内に返信
-
Groc schedules with out of range values pass config validation and fail later when the scheduler is built対応中かも @auraseb が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
autowarefoundation/autoware_carla_scenario#342 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ianktoo/project-monitor#14 ·