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

Address missing processor JsonPropertyDescriptions and validations #4837

Merged
merged 3 commits into from
Aug 21, 2024

Conversation

graytaylor0
Copy link
Member

@graytaylor0 graytaylor0 commented Aug 14, 2024

Description

Adds JsonPropertyDescriptions to all remaining processors that were missing them, and adds validation on construction of the processors for their when condition in the processors that were missing this validation

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

kkondaka
kkondaka previously approved these changes Aug 15, 2024
Copy link
Collaborator

@kkondaka kkondaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thanks for working on this!

@kkondaka
Copy link
Collaborator

@graytaylor0 looks like tests are failing.

@@ -78,6 +79,10 @@ public AggregateProcessor(final AggregateProcessorConfig aggregateProcessorConfi
this.localMode = aggregateProcessorConfig.getLocalMode();

pluginMetrics.gauge(CURRENT_AGGREGATE_GROUPS, aggregateGroupManager, AggregateGroupManager::getAllGroupsSize);

if (aggregateProcessorConfig.getWhenCondition() != null && (!expressionEvaluator.isValidExpressionStatement(aggregateProcessorConfig.getWhenCondition()))) {
Copy link
Collaborator

@oeyh oeyh Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me. Are we adding this validation to all processors now to fail fast on invalid expressions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's right

@@ -57,7 +57,7 @@ public class CsvProcessorConfig {
private List<String> columnNames;

@JsonProperty("csv_when")
@JsonPropertyDescription("Allows you to specify a [conditional expression](https://opensearch.org/docs/latest/data-prepper/pipelines/expression-syntax/), " +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong but I thought we want to keep this markdown format here so it will be rendered in the documentation website. @chenqi0805

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't rendering the documentation website from this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not today, but we are planning to do that, see this: opensearch-project/documentation-website#7651

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. We plan to generate the config table from those annotations

@graytaylor0
Copy link
Member Author

@graytaylor0 looks like tests are failing.

Thanks for reviewing. Yeah looks like I missed the GeoIP integration tests I'll fix them

kkondaka
kkondaka previously approved these changes Aug 16, 2024
Signed-off-by: Taylor Gray <tylgry@amazon.com>
…n, add @Valid annotation for DDB source config models

Signed-off-by: Taylor Gray <tylgry@amazon.com>
chenqi0805
chenqi0805 previously approved these changes Aug 20, 2024
kkondaka
kkondaka previously approved these changes Aug 20, 2024
Signed-off-by: Taylor Gray <tylgry@amazon.com>
@graytaylor0 graytaylor0 dismissed stale reviews from kkondaka and chenqi0805 via c407ece August 20, 2024 22:42
@graytaylor0 graytaylor0 merged commit aa1c5c5 into opensearch-project:main Aug 21, 2024
44 of 47 checks passed
@graytaylor0 graytaylor0 deleted the ProcessorReviews branch August 21, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants