Open mickjermsurawong-stripe opened 1 year ago
Thank you for opening your first issue here! 🛠
@samhita-alla I am interested in doing this issue So kindly assign me this issue Thank You : )
@Kota-Karthik, are you working on creating a PR for this issue?
Hello 👋, this issue has been inactive for over 9 months. To help maintain a clean and focused backlog, we'll be marking this issue as stale and will engage on it to decide if it is still applicable. Thank you for your contribution and understanding! 🙏
Problem: Task taking input of
dataclasses
object withList[T]
will fail deserialization when the object definition is in postponed evaluation mode. The error isValueError: Only generic univariate typing.List[T] type is supported.
failing codeRepro We can reproduce the error in a simpler setup similar to the existing type engine test
Cause: When postponed evaluation is enabled, the type from dataclass fields is a raw string
"List[str]"
, and nottyping
. The current code trying to get subtypeT
inList[T]
thus fails.If
from __future__ import annotations
is removed before the dataclass definition, deserializationto_python_value
above works without error. This is because the field type is oftyping
as expected by the code.Proposal: either make documentation clearer, or handle the type mapping of raw string in this postponed evaluation mode.