ComplexTypeMetaDataMixin.deserialize has no None guard.
まだ誰も着手していません。
評価
調査の方向性
metadata.py を読み、issue で None チェックの欠落が指摘されている ComplexTypeMetaDataMixin.deserialize を見つけてください。まず、提示された BaseDataClass.deserialize(None, set()) の pytest 例を実行するか、必要に応じて調整してください。この入力に対してデシリアライズが None を返し、回帰テストが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Steps to Reproduce:
- Define a Rune type with an optional complex-type field (cardinality 0..1).
- Construct an instance from a dict that omits the field, or pass None for it
explicitly — pydantic calls the field's PlainValidator with obj=None. - Observe the exception.
Expected Result:
None is returned, allowing the optional field to remain absent.
Actual Result:
PydanticCustomError is raised:
"Expected either or dict but got <class 'NoneType'>."
Environment:
rune-python-runtime 2.2.2, pydantic 2.14.1, Python 3.11
Additional Context:
metadata.py ComplexTypeMetaDataMixin.deserialize performs no None check before
the isinstance dispatch chain. None is not a list, not an instance of cls,
not a Reference, and not a dict, so it falls through to the error branch.
Fix: add if obj is None: return None as the first check in deserialize.
import pytest
from pydantic_core import PydanticCustomError
from rune.runtime.base_data_class import BaseDataClass
def test_r1_complex_type_deserialize_none_raises():
'''Passing None to ComplexTypeMetaDataMixin.deserialize raises PydanticCustomError instead of returning None.'''
with pytest.raises(PydanticCustomError):
BaseDataClass.deserialize(None, set())
- 主要言語
- Python
- スター
- 0
- フォーク
- 4
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
finos/rune-python-runtime のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
finos/rune-python-runtime#52 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
finos/rune-python-runtime#51 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
finos/rune-python-runtime#50 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
finos/rune-python-runtime#48 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
finos/rune-python-runtime#43 ·
finos/rune-python-runtime の issue をすべて見る
似ている issue
-
Project submission:オープン
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
slavakurilyak/awesome-ai-agents#845 ·
メンテナーはふだん 1 日以内に返信
-
tests: pin that the atomic writers in utils/paths.py stage the temporary file in the target's directory対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンdifficulty:2 enhancement good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 92/100
MakazhanAlpamys/Soup#2178 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] dcg.waggr permutation p-values are folded twice, so near-zero scores get the smallest p-valuesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
scverse/rapids-singlecell#854 ·
メンテナーはふだん 1 日以内に返信
-
Slang input: int8_t4_packed and uint8_t4_packed are copied into CrossGL対応中かも @ninglinLiu が今日担当しました。 オープンarea:frontend backend:slang bug direction:input
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 13 日以内に返信