Consider this following code:
@dataclass
class Subjects(JSONWizard):
subjectName: str =None
subjectExpert: str = None
subjectScore: float = None
@dataclass
class Student(JSONWizard):
studentName: str
studentId: str
subjects: list[Subjects] = None
teachers: list = None
paidFee: bool = None
gender: str = None
attendancePercentage: float = None
sample_record = {
"studentName":"Naveen", "studentId":"18B91A05L2","Subjects":[{"subjectName":"Telugu","subjectExpert":"Lingeswar","subjectScore":23.5}],
"teachers":["BhaskarRao","LaxmiKumari","Louis"],"paidFee":True,"gender":"M", "attendancePercentage":98.2
}
dataclass_object: Student = Student.from_dict(sample_record)
print(dataclass_object.studentName)
I have ran it in python3.9 and its working fine but in python3.11 I am facing this error:
dataclass_wizard.errors.ParseError: Failure parsing field None
in class None
. Expected a type Any, got NoneType.
value: None
error: Provided type is not currently supported.
unsupported_type: typing.Any
Can someone help me in understanding whats wrong here!