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

Use fastjsonschema instead of jsonschema for validation #146

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Jun 1, 2024

resolves #145

Description

For performance reasons we are replacing jsonschema with fastjsonschema.

Checklist

@gshank gshank requested a review from a team as a code owner June 1, 2024 18:23
@cla-bot cla-bot bot added the cla:yes label Jun 1, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Project coverage is 64.78%. Comparing base (bef3b7d) to head (fdecf8c).

Files Patch % Lines
dbt_common/dataclass_schema.py 96.00% 1 Missing ⚠️
dbt_common/exceptions/base.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #146      +/-   ##
==========================================
+ Coverage   64.33%   64.78%   +0.45%     
==========================================
  Files          51       51              
  Lines        3230     3243      +13     
==========================================
+ Hits         2078     2101      +23     
+ Misses       1152     1142      -10     
Flag Coverage Δ
unit 64.78% <92.30%> (+0.45%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

# former message: "'name' is a required property"
assert (
excinfo.value.message
== "Invalid value '{'an_attr': 'fubar'}': data must contain ['name'] properties"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the other error message look good - essentially saying X is invalid because of Y.

In the case, the invalid value '{'an_attr': 'fubar'}' is invalid because it's missing 1 or more properties. I think it's probably still helpful to name the invalid value (so users can identify where they need to go add the missing properties), so I feel good about this one as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace jsonschema validation with fastjsonschema validation
3 participants