From 4e4c18e69e137c6de084a038605faf16e46df4af Mon Sep 17 00:00:00 2001 From: Hans Keeler Date: Thu, 2 Nov 2023 01:59:16 -0400 Subject: [PATCH] Bring back `describe` sub-command When you only have a single sub-command, `validate` in this case, Typer seems to automatically move that functionality to the top-level command. To get around that strangeness, I've re-added the `describe` command that's intended to print out the file format and the validation list, but isn't implemented yet. For now if you call it, it simply reports _Feature coming soon..._ We'll implement this for real in a follow-up PR sometime soon. --- regtech_data_validator/cli.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/regtech_data_validator/cli.py b/regtech_data_validator/cli.py index 2aa3c1cf..6dbefc10 100644 --- a/regtech_data_validator/cli.py +++ b/regtech_data_validator/cli.py @@ -36,6 +36,15 @@ class OutputFormat(StrEnum): TABLE = 'table' +@app.command() +def describe() -> None: + """ + Describe CFPB data submission formats and validations + """ + + print('Feature coming soon...') + + @app.command(no_args_is_help=True) def validate( path: Annotated[ @@ -61,11 +70,9 @@ def validate( output: Annotated[Optional[OutputFormat], typer.Option()] = OutputFormat.TABLE, ): """ - CFPB's RegTech data validation utility. + Validate CFPB data submission """ context_dict = {x.key: x.value for x in context} if context else {} - - # FIXME: Handle ParserError input_df = pd.read_csv(path, dtype=str, na_filter=False) is_valid, findings_df = validate_phases(input_df, context_dict)