-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[MetricsAdvisor] Fix Update methods issues #16696
Changes from 2 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 |
---|---|---|
|
@@ -19,7 +19,9 @@ public DataFeedMissingDataPointFillSettings() | |
internal DataFeedMissingDataPointFillSettings(DataFeedDetail dataFeedDetail) | ||
{ | ||
FillType = dataFeedDetail.FillMissingPointType; | ||
CustomFillValue = dataFeedDetail.FillMissingPointValue; | ||
CustomFillValue = dataFeedDetail.FillMissingPointType == DataFeedMissingDataPointFillType.CustomValue | ||
? dataFeedDetail.FillMissingPointValue | ||
: null; | ||
Comment on lines
-22
to
+24
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. This was the source of the issue in One of them is There's another property that must be specified when type is When the fill type is NOT We're doing a workaround, but it may be something to fix on the service side. 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. |
||
} | ||
|
||
/// <summary> | ||
|
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.
This was the source of the issue in
UpdateAlertConfiguration
.CrossMetricsOperator
is a nullable struct, and we were mistakenly expectingdefault
to benull
.To make it easier to illustrate, let's use a clearer example:
If
condition == true
, we'll havea = 10
. Ifcondition == false
, we'll havea = 0
(instead ofnull
).The ternary operator is evaluated before the attribution, and the compiler guesses the result must be an
int
, so it makesdefault(int)
instead ofdefault(int?)
. For this reason, we need to make it clear:I have updated other parts of the code in which we had the same issue.
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.
Interesting bug - Seems like it is defined in this issue dotnet/csharplang#33