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

25-validation-error-on-number-fields #29

Merged
merged 11 commits into from
Sep 10, 2024

Conversation

Endlessflow
Copy link
Contributor

@Endlessflow Endlessflow commented Sep 7, 2024

Alright. This PR introduces proper unit tests for the Inspection parsing in test_inspection.py.

I also made some fix in inspection.py that should make everything more robust and prevent complete failure when a field is invalid. The parsing process now tries to handle the invalid fields and in the event that the field can not be handled we default to null.

@snakedye made a good point that eventually we probably want to find a way to be able to tell the difference between an actually empty value and a parsing error but for now I took the liberty to default to None for both.

@k-allagbe you can let me know if you still get issues with the datastore with this fix

closes #25

…Validation

This commit adds unit tests for the NutrientValue, Value, Specification, and NPKValidation classes. The tests cover both valid and invalid cases for each class, ensuring that the classes handle different edge cases correctly.

Issue #25
@Endlessflow Endlessflow linked an issue Sep 7, 2024 that may be closed by this pull request
@Endlessflow Endlessflow marked this pull request as ready for review September 7, 2024 20:14
pipeline/inspection.py Show resolved Hide resolved
pipeline/inspection.py Show resolved Hide resolved
pipeline/inspection.py Show resolved Hide resolved
Copy link
Contributor

@snakedye snakedye left a comment

Choose a reason for hiding this comment

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

LGTM

@k-allagbe k-allagbe merged commit 89d7c7a into main Sep 10, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

Validation error on number fields
3 participants