Skip to content

Commit

Permalink
Bring back describe sub-command
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hkeeler committed Nov 2, 2023
1 parent 6f36b99 commit 4e4c18e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions regtech_data_validator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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[
Expand All @@ -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)

Expand Down

0 comments on commit 4e4c18e

Please sign in to comment.