Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Integrate frictionless baseline validators with workflow_runner #15

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

nathan-yan
Copy link
Collaborator

Changes are:

  1. Remove frictionless validation in the API endpoint, and move it to the workflow_runner validators file.
  2. Create a parse_frictionless function that combines parsing a file into a Frictionless Resource with a Frictionless baseline validator.
  3. Append Frictionless validation failures to the actual workflow failures in the process_workflow function.
  4. Update unit tests

Copy link

github-actions bot commented Oct 17, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
664 635 96% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
server/api/views.py 79% 🟢
server/tests/workflow_runner/test_workflow_runner.py 100% 🟢
server/workflow_runner/validators.py 100% 🟢
server/workflow_runner/workflow_runner.py 94% 🟢
TOTAL 93% 🟢

updated for commit: d5ac1ae by action🐍

@@ -7,7 +7,8 @@ Brazil,Brasília,,5,South America
Pakistan,Islamabad,197015955,6,Asia
Nigeria,Abuja,190886311,7,Africa
Bangladesh,Dhaka,,8,Asia
Russia,Moscow,143989754,9,Europe
Russia,Moscow,notanumber!,9,Europe
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Checking that the Type validator works properly

row_number=row_num,
message=f"Value '{value}' for field '{field.name}' is not a valid number"
# TypeError is raised if value is None
except (TypeError, ValueError) as e:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Idk if this has to do with my python interpreter (i'm using the venv), because I don't know how the original unit tests didn't see this.

But basically the float cast throws a TypeError if the input is None (which happens when there are missing cells), which isn't caught by the original except statement.

requirements.txt Outdated
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if these changes are supposed to be here?

@nathan-yan nathan-yan changed the title #14: Integrate frictionless baseline validators with workflow_runner Integrate frictionless baseline validators with workflow_runner Oct 17, 2024
@nathan-yan nathan-yan added the enhancement New feature or request label Oct 17, 2024
Copy link
Contributor

@jps327 jps327 left a comment

Choose a reason for hiding this comment

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

Thank you for this!
And thanks for being so thorough in your commenting, it really helped in the review.

@jps327 jps327 merged commit 53b8461 into develop Oct 21, 2024
1 check passed
@jps327 jps327 deleted the nathancy-frictionless-parser branch October 21, 2024 13:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate frictionless validators with the existing workflow_runner library
2 participants