datalite
datalite copied to clipboard
Handle Optional[] Types
I tried using this with a dataclass which contained a number of types marked Optional[type]
and it failed with
datalite/commons.py in _convert_type(type_, type_overload)
23 return type_overload[type_]
24 except KeyError:
---> 25 raise TypeError("Requested type not in the default or overloaded type table."
I was able to work around this by defining the fields with default values but it feels like either should work.
Yeah I agree, I don't have much time nowadays but this should be a part of a rewamp of the type system in general, the default behaviour should be to add NOT NULL
when dealing with non-Optional types and Optional should remove that constraint.