I suspect this check, along with the `if sort is not None` below, aren't necessary. I don't think we can have a type without a unit key. Relative to everything else going on in this call, it's trivial to leave it in, but figured I'd throw that out there.