Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upSchema definitions in yaml #91
Open
Labels
Comments
This comment has been minimized.
This comment has been minimized.
@chr1st1ank great idea. As an interim measure, one option I've used is putting the schemas in a .py file and importing that file. Not ideal, but keeps modules a little tidier and enables reuse. |
This comment has been minimized.
This comment has been minimized.
Yes, sounds like a good workaround. And you're totally right that the API should be kept small and neat and not be cluttered with too many capabilities. |
This was referenced Aug 20, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I suggest allowing to pass schemas as yaml files. That way it wouldn't be necessary to hardcode all the checks when using pandera. Instead they would be defined in the yaml schema.
There are two use cases I see:
The yaml format needs to be designed thoroughly in this case to offer optimal flexibility. I could think of something like this:
YAML schema definition:
Python code:
As we probably don't want that arbitrary Python code can be executed from the yaml file with the
!!python
syntax I suggest that we rather go with a mix of built-in checks and the option to add user defined functions as in the example above.