Skip to content

faircode profile --proxy-hints-with silently no-ops without --proxy-hints #347

Description

@yakew7

Where: faircode/cli.py:256-257:

if args.proxy_hints:
    held_out = _build_held_out(args.proxy_hints_with, df)

_build_held_out - which does the actual file-reading, column-checking, and row-count validation for --proxy-hints-with - is only ever called inside if args.proxy_hints:. Passing --proxy-hints-with without also passing --proxy-hints means the flag is parsed by argparse but its value is never even read - not validated, not used, no warning.

Repro:

faircode profile data.csv --proxy-hints-with /nonexistent/file.csv=race

exits 0 with a completely normal profile report - even though the held-out file doesn't exist. The typo (forgetting --proxy-hints) produces total silence instead of an error.

Suggested fix: either error out clearly (error: --proxy-hints-with needs --proxy-hints) when args.proxy_hints_with is set but args.proxy_hints isn't, or have --proxy-hints-with imply --proxy-hints automatically. The former is more consistent with this CLI's existing style of erroring loudly on likely-typo'd flag combinations (see --map's unknown-column check, --cross's same-column check).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions