danielgtaylor / danielgtaylor/python-betterproto

from_dict() does not cast floating point types

オープン
#96 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug good first issue low priority small
主要言語
Python
スター
1.8k
フォーク
234
PR マージ指標
30日以内にマージされた PR はありません

説明

When you pass in the dictionary a float to an int field, this is casted to int (line 890 `betterproto/__init__.py`). I would expect a similar behaviour in the reverse situation when you pass an int to a float field. Right now you end up with an object having an int in a field which should contain a float.

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

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

調査の方向性

betterproto/__init__.py の 890 行目から始め、整数フィールドと浮動小数点フィールドに対する from_dict() の処理を追跡します。期待される逆変換を確認し、その後、整数入力によって浮動小数点値のフィールドが生成されることを、既存の整数変換の動作を変更せずに検証します。

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

評価

技術スタック
python
領域
backend-api-design
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

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

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