Skip to content

Similar logic to .explain(), create a function to show unneeded options or missing options #14

@richardhathaway-8451

Description

@richardhathaway-8451

Similar to explain create a function to show unneeded options or missing options. For example, consider a large application with many options and datasets, one of which is below.

@dataset
def foo(
    region = Option("APPLICATION.REGION", "North")
):
    ...

A user may mistakenly add an option to their options dictionary with a small typo, such as {"APPLICATION": {"REGIONS": "South"}}, mistaking "REGION" for "REGIONS". The application would still run without error because the option has a default value, but it would run with a wrong value, and the user might not catch the mistake.

A function that would show the user what options are missing from the config and what options are not used (because they are entered incorrectly) would help validate options dictionaries. For example:

options = {"APPLICATION": {"REGIONS": "South"}}
validate(foo, options)

# Missing options: 'APPLICATION.REGION'
# Unused options: 'APPLICATION.REGIONS'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions