@dataclass
class SomeClass:
maybeDog: Optional[Dog]
instance = getInst() # lets say getInst() serializes an input with that dataclass, gets value through validated_data
if instance.maybeDog: # this is always truthy, because when maybeDog is absent its value is acessed as field.empty
print('bark')