Aggregations: Add better validation of moving_avg model settings #12280
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds proper validation of the settings passed to a moving average model. You will now get an exception if you try to pass an unknown, non-whitelisted parameter to a model, instead of silently dropping it on the floor.
The only point of contention is that I added a
settings()method to the MovingAvgBuilder, so that this could be tested, and perhaps allow users to specify all the parameters in one pass. This is opposed to specifying all the parameters on the model builder itself, which only allows you to specify applicable params.So on one hand the
settings()param more closely mimics the REST api and allows convenience, on the other hand it provides a small foot gun.@colings86 If you could take a peek at this when you get time, it'd be swell. No rush, pretty low priority ❤️