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

ComplexTypeMetaDataMixin.deserialize has no None guard.

オープン 初心者向け
#47 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

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

調査の方向性

metadata.py を読み、issue で None チェックの欠落が指摘されている ComplexTypeMetaDataMixin.deserialize を見つけてください。まず、提示された BaseDataClass.deserialize(None, set()) の pytest 例を実行するか、必要に応じて調整してください。この入力に対してデシリアライズが None を返し、回帰テストが通れば完了です。

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

説明

Steps to Reproduce:
  1. Define a Rune type with an optional complex-type field (cardinality 0..1).
  2. 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.
  3. 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

環境構築

はじめの一歩

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

finos/rune-python-runtime のほかの issue

finos/rune-python-runtime の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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