Closed naegelejd closed 11 months ago
This is a very minor bug, but it led to a necessary review of how the generated Python get_dtype function should work.
get_dtype
Given a model with an aliased, generic type:
GenericRecord<T>: !record fields: v: T AliasedRecord<T>: GenericRecord<T>
If I call get_dtype on GenericRecord without specifying type arguments, I get a useful error message:
m.get_dtype(m.GenericRecord) ... RuntimeError: Generic type arguments not provided for <class 'm.types.GenericRecord'>
But if I do the same for the aliased type, I do not get the same, expected error message:
m.get_dtype(m.AliasedRecord) ... RuntimeError: Cannot find dtype for ~T
The user does not know what ~T is.
~T
This is a very minor bug, but it led to a necessary review of how the generated Python
get_dtype
function should work.Given a model with an aliased, generic type:
If I call
get_dtype
on GenericRecord without specifying type arguments, I get a useful error message:But if I do the same for the aliased type, I do not get the same, expected error message:
The user does not know what
~T
is.