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

Bugfix/jsonschema #577

Merged
merged 10 commits into from
Dec 5, 2024
Merged

Bugfix/jsonschema #577

merged 10 commits into from
Dec 5, 2024

Conversation

ggsdc
Copy link
Member

@ggsdc ggsdc commented Dec 4, 2024

This PR should implement json schmea validation for instance, solution, instance checks and solution checks on the airflow side.

It should fix #575 and fix #576

@ggsdc ggsdc added bug Something isn't working enhancement New feature or request client Issues relating to the client library dags Issues relating to the dags labels Dec 4, 2024
@ggsdc ggsdc added this to the v1.2.0 milestone Dec 4, 2024
@ggsdc ggsdc requested a review from JaimeSotomayor December 4, 2024 09:27
@ggsdc ggsdc self-assigned this Dec 4, 2024
@ggsdc ggsdc changed the base branch from master to develop December 4, 2024 09:28
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 85.29412% with 10 lines in your changes missing coverage. Please review.

Project coverage is 75.38%. Comparing base (a34a01d) to head (e251883).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #577      +/-   ##
===========================================
+ Coverage    75.29%   75.38%   +0.08%     
===========================================
  Files          258      258              
  Lines        14430    14485      +55     
  Branches      2078     2003      -75     
===========================================
+ Hits         10865    10919      +54     
- Misses        3104     3112       +8     
+ Partials       461      454       -7     
Flag Coverage Δ
client-tests 78.13% <90.47%> (+0.41%) ⬆️
dags-tests 77.82% <85.71%> (+0.07%) ⬆️
server-tests 77.89% <40.00%> (ø)

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

Components Coverage Δ
server 77.89% <40.00%> (ø)
client 78.13% <90.47%> (+0.41%) ⬆️
dags 77.82% <85.71%> (+0.07%) ⬆️

ggsdc added 3 commits December 4, 2024 10:53
…PR and we see that we do not ahve any new issues with how the application solve actually works
@@ -181,6 +184,12 @@ def solve(

instance_checks = SuperDict(inst.check())

inst_errors = inst.validate_checks(instance_checks)
Copy link
Contributor

Choose a reason for hiding this comment

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

i wouldn't use "inst_errors" again because it can be confusing with the errors of the instance schema. I think "inst_checks_errors" is better.
And the same with "inst_errors". I would prefer "inst_squema_errors"

If anything, two different names. If you like to keep "inst_errors" for me that would be for the checks. And for the squema of the instance i would use inst_squema_errors

Copy link
Member Author

Choose a reason for hiding this comment

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

I have changed the way it is done. See if you like it.

ampuerin
ampuerin previously approved these changes Dec 4, 2024
"""
checks = self.check()
validator = Draft7Validator(self.schema_checks)
if not validator.is_valid(checks):
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be interesting to include a warning message when, despite the schema validation being correct, it is detected that the tables or columns of the json being validated are not in the schema. And print the tables or columns that are not being checked.
This applies to all schema validations.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you create an issue with this, because I do not think with the current jsonschema package taht we use is not possible but I will checkj it out, so I want to close this PR without this.

@ggsdc ggsdc merged commit ed58530 into develop Dec 5, 2024
33 of 35 checks passed
@ggsdc ggsdc deleted the bugfix/jsonschema branch December 5, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client Issues relating to the client library dags Issues relating to the dags enhancement New feature or request
Projects
None yet
3 participants