Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate that definitions only contain valid parameters for type #622

Open
mikewilli opened this issue Sep 25, 2024 · 0 comments
Open

Validate that definitions only contain valid parameters for type #622

mikewilli opened this issue Sep 25, 2024 · 0 comments
Labels
config-parser related to config parsing as opposed to metric definitions

Comments

@mikewilli
Copy link
Collaborator

A typo like data_sources vs data_source can go unnoticed in a metric config like this:

[metrics.whatever]
data_sources = "my_data"

This parameter should be data_source (singular), but instead it is ignored and so an unrelated error is thrown in CI that doesn't point directly to the problem.

We should add validation to the definition classes that ensures all keys specified in the TOML are valid for the class. This validation also needs to have a list of "extra" keys that are valid for any class because there are additional keys added to certain configs for use outside of metric-config-parser etc. that we need to continue allowing (e.g., deprecated).

Perhaps this validation could be a function in a parent class to all of the definition classes so that each inherits it by default (and can override if needed -- perhaps for the "extra" keys valid for that class?).

@mikewilli mikewilli added the config-parser related to config parsing as opposed to metric definitions label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config-parser related to config parsing as opposed to metric definitions
Projects
None yet
Development

No branches or pull requests

1 participant