def _unwrap_type()

in dataset/types.py [0:0]


def _unwrap_type(tp):
    # strips Optional wrapper, if any
    if _get_origin(tp) is typing.Union:
        args = typing.get_args(tp)
        if len(args) == 2 and any(a is type(None) for a in args):
            # this is typing.Optional
            return args[0] if args[1] is type(None) else args[1]
    return tp