Similar logic to `.explain()`, create a function to show unneeded options or missing options
- 主要语言
- Python
- 星标
- 17
- 派生
- 1
- PR 合并指标
- 30 天内没有已合并 PR
描述
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'
```
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。