Skip to content

Commit

Permalink
Ma remove readonly assignments (#14478)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyan99 authored Oct 13, 2020
1 parent 4446cc0 commit 91ca08f
Showing 1 changed file with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2356,19 +2356,19 @@ def __init__(
super(Incident, self).__init__(**kwargs)
self.metric_id = kwargs.get('metric_id', None)
self.detection_configuration_id = kwargs.get('detection_configuration_id', None)
self.incident_id = kwargs.get('incident_id', None)
self.id = kwargs.get('id', None)
self.start_time = kwargs.get('start_time', None)
self.last_time = kwargs.get('last_time', None)
self.dimension_key = kwargs.get('dimension_key', None)
self.severity = kwargs.get('severity', None)
self.status = kwargs.get('status', None)

def __repr__(self):
return "Incident(metric_id={}, detection_configuration_id={}, incident_id={}, start_time={}, last_time={}, " \
return "Incident(metric_id={}, detection_configuration_id={}, id={}, start_time={}, last_time={}, " \
"dimension_key={}, severity={}, status={})".format(
self.metric_id,
self.detection_configuration_id,
self.incident_id,
self.id,
self.start_time,
self.last_time,
self.dimension_key,
Expand All @@ -2390,7 +2390,7 @@ def _from_generated(cls, incident_result):
return cls(
metric_id=incident_result.metric_id,
detection_configuration_id=incident_result.anomaly_detection_configuration_id,
incident_id=incident_result.incident_id,
id=incident_result.incident_id,
start_time=incident_result.start_time,
last_time=incident_result.last_time,
dimension_key=dimension_key,
Expand Down Expand Up @@ -2565,9 +2565,6 @@ def _to_generated(self):
dimension_filter = FeedbackDimensionFilter(dimension=self.dimension_key)
value = AnomalyFeedbackValue(anomaly_value=self.value)
return _AnomalyFeedback(
feedback_id=self.id,
created_time=self.created_time,
user_principal=self.user_principal,
metric_id=self.metric_id,
dimension_filter=dimension_filter,
start_time=self.start_time,
Expand Down Expand Up @@ -2675,9 +2672,6 @@ def _to_generated(self):
dimension_filter = FeedbackDimensionFilter(dimension=self.dimension_key)
value = ChangePointFeedbackValue(change_point_value=self.value)
return _ChangePointFeedback(
feedback_id=self.id,
created_time=self.created_time,
user_principal=self.user_principal,
metric_id=self.metric_id,
dimension_filter=dimension_filter,
start_time=self.start_time,
Expand Down Expand Up @@ -2783,9 +2777,6 @@ def _to_generated(self):
dimension_filter = FeedbackDimensionFilter(dimension=self.dimension_key)
value = CommentFeedbackValue(comment_value=self.value)
return _CommentFeedback(
feedback_id=self.id,
created_time=self.created_time,
user_principal=self.user_principal,
metric_id=self.metric_id,
dimension_filter=dimension_filter,
start_time=self.start_time,
Expand Down Expand Up @@ -2885,9 +2876,6 @@ def _to_generated(self):
dimension_filter = FeedbackDimensionFilter(dimension=self.dimension_key)
value = PeriodFeedbackValue(period_type=self.period_type, period_value=self.value)
return _PeriodFeedback(
feedback_id=self.id,
created_time=self.created_time,
user_principal=self.user_principal,
metric_id=self.metric_id,
dimension_filter=dimension_filter,
value=value,
Expand Down

0 comments on commit 91ca08f

Please sign in to comment.