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

Expand Error Reporting #146

Open
AdamTheisen opened this issue Apr 20, 2023 · 0 comments
Open

Expand Error Reporting #146

AdamTheisen opened this issue Apr 20, 2023 · 0 comments

Comments

@AdamTheisen
Copy link

Hello! I was just starting to work with this a bit to see if it could be used for the purposes of validating data files against our standards. One of the items that would be helpful is to improve the error reporting. I would see two things

  1. Report all differences and not just one at a time. I.e. if I have 10 errors between my object and the schema, I want to see all those and not just the first one to fail.
  2. More information would be great. As of now, it throws an error and we get the traceback like the below. It would be great if it would print out more information down to the variable tested. Something like
    lat: Expected: float32.   Found:  U32
    lon: Expected: float32.   Found:  U32
    time: Variable expected but not found

Traceback error currently reporting

Traceback (most recent call last):
  File "/Users/atheisen/Code/development-space/arm_data_validator.py", line 33, in <module>
    schema_lat.validate(ds['lat'])
  File "/opt/anaconda3/lib/python3.10/site-packages/xarray_schema/dataarray.py", line 196, in validate
    self.dtype.validate(da.dtype)
  File "/opt/anaconda3/lib/python3.10/site-packages/xarray_schema/components.py", line 29, in validate
    raise SchemaError(f'dtype {dtype} != {self.dtype}')
xarray_schema.base.SchemaError: dtype <U32 != float32
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