When I run mypy checkings I am getting an error. I am no able to ignore it or turn it off the strict optional checking. It there a way to solve this.
Here is the line that is throwing the error:
if tree.data.attributes.custom != JAPAN:
where attributes is declared as:
class TreeAttributesModel(BaseModel):
id: Optional[TreeId]
name: Optional[str] = None
status: StatusEnum
custom: Optional[CustomAttrsModel] = None
and CustomAttrsModel is declared as it follows:
class CustomAttrsModel(BaseModel):
seller: Optional[str]
buyed_at: Optional[datetime]
country: Optional[Union[CountryEnum, str]]
Could you please help me with this?