Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong error message in Python get_dtype for generic type missing type arguments #85

Closed
naegelejd opened this issue Oct 23, 2023 · 0 comments

Comments

@naegelejd
Copy link
Contributor

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:

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.

naegelejd added a commit that referenced this issue Oct 23, 2023
@naegelejd naegelejd mentioned this issue Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant