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

looper is not validating inputs correctly #523

Open
nsheff opened this issue Sep 19, 2024 · 3 comments
Open

looper is not validating inputs correctly #523

nsheff opened this issue Sep 19, 2024 · 3 comments
Labels

Comments

@nsheff
Copy link
Contributor

nsheff commented Sep 19, 2024

If I say that an input attribute is required in the input schema, then if I don't specify a value for that attribute in the CSV file, I expect looper to not submit the job.

But what happens is, looper still submits the job.

I am putting an example in the hello_looper repo.

@nsheff nsheff added the bug label Sep 19, 2024
@donaldcampbelljr
Copy link
Contributor

Confirming: the usa sample fails when running the hello_looper example input_schema_example because there is no data at the file_path. However, if I add the data, the usa sample should still fail because there is no area_type provided in the sample table, but it passes and looper submits the job without issue.

During sample validation, sample_schema_dict looks appropriate:
image

But the usa sample.to_dict() has an empty string for area type:
image

And this appears to allow the sample to pass without issue during eido's _validate_object call:
validator.is_valid(obj)

Deleting the area_type key from the obj and re-running is_valid does cause validation failure as expected.

It appears that peppy's sample.to_dict() should remove keys if values are empty? Or perhaps eido should preprocess the sample dict to remove empty items before validation?

@nsheff
Copy link
Contributor Author

nsheff commented Oct 1, 2024

just add minLength:1 to the schema.

having an attribute present is not the same thing as having something in the attribute.

@donaldcampbelljr
Copy link
Contributor

  • update docs to state requiring minLength in schema to have this work as the user expects

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

No branches or pull requests

2 participants