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

Input Validation #34

Open
4 tasks
cam-barts opened this issue Oct 29, 2019 · 4 comments
Open
4 tasks

Input Validation #34

cam-barts opened this issue Oct 29, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@cam-barts
Copy link

cam-barts commented Oct 29, 2019

Description
In order to aid with he future testing story, we should have some user input validation. For example, if a table expects a name and an email address, we should check if the user actually gives a name and an properly formatted email address.

Feature Details

  • The framework should support built in validators.
  • It should also allow the developer to create custom validators.
  • The framework should enforce the validator, displaying validation errors.
  • This behavior should also have the ability to be overwritten somehow.
@cam-barts cam-barts changed the title Input Validation [Feature Request]Input Validation Oct 29, 2019
@lanmaster53 lanmaster53 added the enhancement New feature or request label Oct 30, 2019
@lanmaster53 lanmaster53 changed the title [Feature Request]Input Validation Input Validation Oct 30, 2019
@lanmaster53
Copy link
Owner

So, an idea. Do transform level validation automatically at the framework level based on the expected incoming data. Module devs then have the ability to override this method with their own validation logic if needed.

@cam-barts cam-barts mentioned this issue Oct 30, 2019
2 tasks
@lanmaster53
Copy link
Owner

Idea continued. Build a validation method in the module.py module that detects the input item's type based on module path and calls the associated validator. That way, in one-off situations, a mod dev can just just override that method.

We will need logic to determine if a module actually transforms something and disable the validator otherwise. There are reporting, import, etc. modules that don’t apply. Looking for a "-" in the second segment of the path may be enough.

@lanmaster53
Copy link
Owner

Well crud, that won't work. Input can be anything within a given table. The above idea only determines the table. We're going to have to use some sort of metadata key to tell the framework which validator to use, or a custom one.

@cam-barts
Copy link
Author

We can build validators that validate whole rows before they go in. Like validate every column in a contact as either valid or empty, except notes. Using a series of underlying single item validators. Could be good for user defined seed material too.

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

No branches or pull requests

2 participants