dbt-sugar
dbt-sugar copied to clipboard
Figure out a way to let users add complex tests
@virvirlopez we forgot to test subprocess and I also have some questions regarding the user flow and how we let people add tests via the CLI (especially for more complex tests which take several arguments).
I was just thinking this morning that for complex tests (i.e. ones with arguments which could end up being just about anything we may want to pop an editor like vim or nano to allow the users to enter the part of the yaml they would otherwise write in the schema file.
We would then add it to the schema yaml, call dbt for test and validation and remove it if it doesn't work (just like we do now).
I think the easiest way I know to pop an editor for multiline input would be to use click.edit
which will take care of reading the editor chosen in the user's env and fall back to something if not: https://click.palletsprojects.com/en/7.x/utils/#launching-editors.
We should follow up the subprocess PR (#108 ) shortly with a PR that allows this and work on the user experience