-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(aci): Add support for an empty conditionGroup in the API for the Error detector #112641
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,14 @@ | |
| class ErrorDetectorValidator(BaseDetectorTypeValidator): | ||
| data_source_required = False | ||
|
|
||
| # TODO - Update the Error Detector to store grouping rules in the DataCondition | ||
| condition_group = serializers.DictField( | ||
| required=False, | ||
| allow_null=True, | ||
| ) # type: ignore[assignment] # Intentionally overrides nested serializer to accept empty dicts | ||
|
|
||
| fingerprinting_rules = serializers.CharField(required=False, allow_blank=True, allow_null=True) | ||
|
|
||
| resolve_age = EmptyIntegerField( | ||
| required=False, | ||
| allow_null=True, | ||
|
|
@@ -31,11 +38,12 @@ def validate_type(self, value: str) -> builtins.type[GroupType]: | |
| return type | ||
|
|
||
| def validate_condition_group(self, value: Any) -> Any: | ||
| if value is not None: | ||
| if value: | ||
| raise serializers.ValidationError( | ||
| "Condition group is not supported for error detectors" | ||
| ) | ||
| return value | ||
|
|
||
| return None | ||
|
Comment on lines
40
to
+46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Returning Suggested FixEither modify Prompt for AI Agent
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed the |
||
|
|
||
| def validate_name(self, value: Any) -> str: | ||
| # if name is different from existing, raise an error | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just fyi - the TODO is the point in which we could clean this up. the problem is mostly related to the error detector not storing the grouping rules as data conditions / this model.