-
Notifications
You must be signed in to change notification settings - Fork 122
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
feat! [Python] リテラル型をnon exhaustiveに #957
feat! [Python] リテラル型をnon exhaustiveに #957
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
結構pydanticの機能に依存している箇所があると思うので、pydanticのバージョンをあげたときもちゃんと動作していることを確認するテストを追加しても良いのかもなーと感じました!
(ちょっとちゃんと把握してないのでどういうテストがいるのか、そもそも必要なのかわかってませんが・・・)
不要だったらマージ、あったほうが良ければ実装&再レビュー、もしくはissue化とかで良さそう!
|
814db3a
to
337d2ab
Compare
ちょっと理解しきれていないのですが、正常系は既にいっぱいパスが通っていることを考えるとエラー周りですかね?例えば不正な文字列を入れたら変な例外ではなくちゃんと 例: voicevox_core/crates/voicevox_core_python_api/python/test/test_blocking_user_dict_manipulate.py Lines 77 to 83 in 2410043
|
|
あ、ですです! あるとしたら追加された想定外の文字が渡されたパターンと、あと |
なるほどです。であればさっき追加したテストで両方カバーできているかなと思いました。 |
内容
#941, #955, #950 の続き。
_Reserved
はvoicevox_core._models._Reserved
voicevox_core._models._please_do_not_use._Reserved
としてでしか存在せず、ユーザーは原則触ることはできない状態にしてある。不正な値を入れようとしたときのPydanticのエラーはこうなる。
またドキュメントはこんな感じ。
_Reserved
にリンクが張られていないのは、上記の通り意図したもの。関連 Issue
その他