Skip to content

Commit 05be0b7

Browse files
committed
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python into expose_parse_vault_id
* 'master' of https://github.com/Azure/azure-sdk-for-python: (37 commits) [text analytics] add versionadded sphinx documentation (Azure#13450) [text analytics] add bing_id property to LinkedEntity class (Azure#13446) fix typing for paging methods (Azure#13410) [text analytics] add domain_filter param (Azure#13451) fix issue Azure#11658 for is_valid_resource_id (Azure#11709) added create_table_if_not_exists method to table service client (Azure#13385) [ServiceBus] Test and failure improvements (Azure#13345) Proper encoding and decoding of source URLs - Fixes special characters in source URL issue (Azure#13275) Switch retry (Azure#13264) [ServiceBus] ServiceBusClient close spawned children (Azure#13077) fixing version issue by not overwriting the version with the semantic… (Azure#13411) clean up reference and tests (Azure#13412) Consistent returns (Azure#13245) [text analytics] return None for offset and length for v3.0 (Azure#13382) edit all authentication files and add a test (Azure#13355) Add managed_identity_client_id argument to DefaultAzureCredential (Azure#13218) [text analytics] add string-index-type support (Azure#13378) [text analytics] fix error response if pii entities is called from v3.0 client (Azure#13383) Send spec (Azure#13143) Anomaly Detector 3.0.0b2 release (Azure#13351) ...
2 parents 1a5c23b + 537dd08 commit 05be0b7

File tree

1,083 files changed

+47002
-12241
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,083 files changed

+47002
-12241
lines changed

eng/common/pipelines/templates/steps/create-pull-request.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ parameters:
1111
PushArgs:
1212
WorkingDirectory: $(System.DefaultWorkingDirectory)
1313
PRTitle: not-specified
14-
PRBody: not-specified
14+
PRBody: ''
1515
ScriptDirectory: eng/common/scripts
1616
GHReviewersVariable: ''
1717
GHTeamReviewersVariable: ''
@@ -68,12 +68,13 @@ steps:
6868
-PRBranch "${{ parameters.PRBranchName }}"
6969
-AuthToken "$(azuresdk-github-pat)"
7070
-PRTitle "${{ parameters.PRTitle }}"
71+
-PRBody "${{ coalesce(parameters.PRBody, parameters.CommitMsg, parameters.PRTitle) }}"
7172
-PRLabels "${{ parameters.PRLabels}}"
72-
-PRBody "${{ parameters.PRBody }}"
7373
7474
- task: PowerShell@2
7575
displayName: Tag a Reviewer on PR
7676
condition: and(succeeded(), eq(variables['HasChanges'], 'true'))
77+
continueOnError: true
7778
inputs:
7879
pwsh: true
7980
workingDirectory: ${{ parameters.WorkingDirectory }}

eng/common/pipelines/templates/steps/get-pr-owners.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,20 @@ steps:
1818
--kusto-database-var KUSTO_DB `
1919
--kusto-table-var KUSTO_TABLE `
2020
--identity "$(Build.QueuedBy)"
21-
$resolvedIdentity = $result[-1] | ConvertFrom-Json
2221
23-
Write-Host $resolvedIdentity
22+
$resolvedIdentity = ""
23+
try { $resolvedIdentity = $result[-1] | ConvertFrom-Json } catch {}
2424
25-
Write-Output "##vso[task.setvariable variable=${{ parameters.TargetVariable }}]$($resolvedIdentity.GithubUserName)"
25+
if($resolvedIdentity) {
26+
Write-Host $resolvedIdentity
27+
28+
Write-Host "##vso[task.setvariable variable=${{ parameters.TargetVariable }}]$($resolvedIdentity.GithubUserName)"
29+
}
30+
else {
31+
Write-Host "Unable to locate a github user for identity $(Build.QueuedBy)"
32+
}
2633
displayName: 'Resolving Queuing User'
34+
continueOnError: true
2735
workingDirectory: $(Build.SourcesDirectory)/tools_repo/tools/notification-configuration/identity-resolver
2836
env:
2937
APP_ID: $(notification-aad-app-id)
@@ -41,6 +49,6 @@ steps:
4149
$originalValue = "$(${{ parameters.TargetVariable }})"
4250
$result = $(Build.SourcesDirectory)/eng/common/scripts/get-codeowners.ps1 -TargetDirectory /sdk/${{ parameters.ServiceDirectory }}/ -RootDirectory $(Build.SourcesDirectory)
4351
if ($result) {
44-
Write-Output "##vso[task.setvariable variable=${{ parameters.TargetVariable }}]$originalValue,$result"
52+
Write-Host "##vso[task.setvariable variable=${{ parameters.TargetVariable }}]$originalValue,$result"
4553
}
4654
displayName: Add CodeOwners if Present

eng/common/scripts/Submit-PullRequest.ps1

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ The branch which we want to create a pull request for.
1717
A personal access token
1818
.PARAMETER PRTitle
1919
The title of the pull request.
20+
.PARAMETER PRBody
21+
The body message for the pull request.
2022
.PARAMETER PRLabels
2123
The labels added to the PRs. Multple labels seperated by comma, e.g "bug, service"
2224
#>
@@ -42,7 +44,9 @@ param(
4244

4345
[Parameter(Mandatory = $true)]
4446
[string]$PRTitle,
45-
$PRBody = $PRTitle,
47+
48+
[Parameter(Mandatory = $false)]
49+
[string]$PRBody = $PRTitle,
4650

4751
[Parameter(Mandatory = $false)]
4852
[string]$PRLabels

eng/common/scripts/add-pullrequest-reviewers.ps1

+29-48
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,32 @@ param(
1818
$AuthToken
1919
)
2020

21+
function AddMembers($memberName, $additionSet) {
22+
$headers = @{
23+
Authorization = "bearer $AuthToken"
24+
}
25+
$uri = "https://api.github.com/repos/$RepoOwner/$RepoName/pulls/$PRNumber/requested_reviewers"
26+
$errorOccurred = $false
27+
28+
foreach ($id in $additionSet) {
29+
try {
30+
$postResp = @{}
31+
$postResp[$memberName] = @($id)
32+
$postResp = $postResp | ConvertTo-Json
33+
34+
Write-Host $postResp
35+
$resp = Invoke-RestMethod -Method Post -Headers $headers -Body $postResp -Uri $uri -MaximumRetryCount 3
36+
$resp | Write-Verbose
37+
}
38+
catch {
39+
Write-Host "Error attempting to add $user `n$_"
40+
$errorOccurred = $true
41+
}
42+
}
43+
44+
return $errorOccurred
45+
}
46+
2147
# at least one of these needs to be populated
2248
if (-not $GitHubUsers -and -not $GitHubTeams) {
2349
Write-Host "No user provided for addition, exiting."
@@ -27,54 +53,9 @@ if (-not $GitHubUsers -and -not $GitHubTeams) {
2753
$userAdditions = @($GitHubUsers.Split(",") | % { $_.Trim() } | ? { return $_ })
2854
$teamAdditions = @($GitHubTeams.Split(",") | % { $_.Trim() } | ? { return $_ })
2955

30-
$headers = @{
31-
Authorization = "bearer $AuthToken"
32-
}
33-
$uri = "https://api.github.com/repos/$RepoOwner/$RepoName/pulls/$PRNumber/requested_reviewers"
56+
$errorsOccurredAddingUsers = AddMembers -memberName "reviewers" -additionSet $userAdditions
57+
$errorsOccurredAddingTeams = AddMembers -memberName "team_reviewers" -additionSet $teamAdditions
3458

35-
try {
36-
$resp = Invoke-RestMethod -Headers $headers $uri -MaximumRetryCount 3
37-
}
38-
catch {
39-
Write-Error "Invoke-RestMethod [$uri] failed with exception:`n$_"
59+
if ($errorsOccurredAddingUsers -or $errorsOccurredAddingTeams) {
4060
exit 1
4161
}
42-
43-
# the response object takes this form: https://developer.github.com/v3/pulls/review_requests/#response-1
44-
# before we can push a new reviewer, we need to pull the simple Ids out of the complex objects that came back in the response
45-
$userReviewers = @($resp.users | % { return $_.login })
46-
$teamReviewers = @($resp.teams | % { return $_.slug })
47-
48-
if (!$userReviewers) { $modifiedUserReviewers = @() } else { $modifiedUserReviewers = $userReviewers.Clone() }
49-
$modifiedUserReviewers += ($userAdditions | ? { !$modifiedUserReviewers.Contains($_) })
50-
51-
if ($teamReviewers) { $modifiedTeamReviewers = @() } else { $modifiedTeamReviewers = $teamReviewers.Clone() }
52-
$modifiedTeamReviewers += ($teamAdditions | ? { !$modifiedTeamReviewers.Contains($_) })
53-
54-
$detectedUserDiffs = Compare-Object -ReferenceObject $userReviewers -DifferenceObject $modifiedUserReviewers
55-
$detectedTeamDiffs = Compare-Object -ReferenceObject $teamReviewers -DifferenceObject $modifiedTeamReviewers
56-
57-
# Compare-Object returns values when there is a difference between the comparied objects.
58-
# we only want to run the update if there IS a difference.
59-
if ($detectedUserDiffs -or $detectedTeamDiffs) {
60-
$postResp = @{}
61-
62-
if ($modifiedUserReviewers) { $postResp["reviewers"] = $modifiedUserReviewers }
63-
if ($modifiedTeamReviewers) { $postResp["team_reviewers"] = $modifiedTeamReviewers }
64-
65-
$postResp = $postResp | ConvertTo-Json
66-
67-
try {
68-
Write-Host $postResp
69-
$resp = Invoke-RestMethod -Method Post -Headers $headers -Body $postResp -Uri $uri -MaximumRetryCount 3
70-
$resp | Write-Verbose
71-
}
72-
catch {
73-
Write-Error "Unable to update PR reviewers. `n$_"
74-
}
75-
}
76-
else {
77-
$results = $GitHubUsers + $GitHubTeams
78-
Write-Host "Reviewers $results already added. Exiting."
79-
exit(0)
80-
}

sdk/anomalydetector/azure-ai-anomalydetector/CHANGELOG.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Release History
22

3-
## 3.0.0b2 (Unreleased)
3+
## 3.0.0b2 (2020-08-27)
4+
5+
**Bug Fixes**
6+
- Fixed an issue with ChangePointDetect
7+
8+
**Breaking Changes**
9+
- Renamed `entire_detect` to `detect_entire_series`
10+
- Renamed `APIError` to `AnomalyDetectorError`
11+
- Renamed `Request` to `DetectRequest`
12+
- Renamed `LastDetect` to `DetectLastPoint`
13+
- Renamed `ChangePointDetect` to `DetectChangePoint`
14+
- Renamed `Granularity` to `TimeGranularity`
15+
- Renamed `minutely` and `secondly` to `per_minute` and `per_second`
16+
- Renamed `Point` to `TimeSeriesPoint`
417

518

619
## 3.0.0b1 (2020-08-17)

sdk/anomalydetector/azure-ai-anomalydetector/azure/ai/anomalydetector/aio/operations_async/_anomaly_detector_client_operations_async.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
class AnomalyDetectorClientOperationsMixin:
2121

22-
async def entire_detect(
22+
async def detect_entire_series(
2323
self,
24-
body: "models.Request",
24+
body: "models.DetectRequest",
2525
**kwargs
2626
) -> "models.EntireDetectResponse":
2727
"""Detect anomalies for the entire series in batch.
@@ -32,7 +32,7 @@ async def entire_detect(
3232
3333
:param body: Time series points and period if needed. Advanced model parameters can also be set
3434
in the request.
35-
:type body: ~azure.ai.anomalydetector.models.Request
35+
:type body: ~azure.ai.anomalydetector.models.DetectRequest
3636
:keyword callable cls: A custom type or function that will be passed the direct response
3737
:return: EntireDetectResponse, or the result of cls(response)
3838
:rtype: ~azure.ai.anomalydetector.models.EntireDetectResponse
@@ -44,7 +44,7 @@ async def entire_detect(
4444
content_type = kwargs.pop("content_type", "application/json")
4545

4646
# Construct URL
47-
url = self.entire_detect.metadata['url'] # type: ignore
47+
url = self.detect_entire_series.metadata['url'] # type: ignore
4848
path_format_arguments = {
4949
'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
5050
}
@@ -59,7 +59,7 @@ async def entire_detect(
5959
header_parameters['Accept'] = 'application/json'
6060

6161
body_content_kwargs = {} # type: Dict[str, Any]
62-
body_content = self._serialize.body(body, 'Request')
62+
body_content = self._serialize.body(body, 'DetectRequest')
6363
body_content_kwargs['content'] = body_content
6464
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
6565

@@ -68,7 +68,7 @@ async def entire_detect(
6868

6969
if response.status_code not in [200]:
7070
map_error(status_code=response.status_code, response=response, error_map=error_map)
71-
error = self._deserialize(models.APIError, response)
71+
error = self._deserialize(models.AnomalyDetectorError, response)
7272
raise HttpResponseError(response=response, model=error)
7373

7474
deserialized = self._deserialize('EntireDetectResponse', pipeline_response)
@@ -77,11 +77,11 @@ async def entire_detect(
7777
return cls(pipeline_response, deserialized, {})
7878

7979
return deserialized
80-
entire_detect.metadata = {'url': '/timeseries/entire/detect'} # type: ignore
80+
detect_entire_series.metadata = {'url': '/timeseries/entire/detect'} # type: ignore
8181

82-
async def last_detect(
82+
async def detect_last_point(
8383
self,
84-
body: "models.Request",
84+
body: "models.DetectRequest",
8585
**kwargs
8686
) -> "models.LastDetectResponse":
8787
"""Detect anomaly status of the latest point in time series.
@@ -92,7 +92,7 @@ async def last_detect(
9292
9393
:param body: Time series points and period if needed. Advanced model parameters can also be set
9494
in the request.
95-
:type body: ~azure.ai.anomalydetector.models.Request
95+
:type body: ~azure.ai.anomalydetector.models.DetectRequest
9696
:keyword callable cls: A custom type or function that will be passed the direct response
9797
:return: LastDetectResponse, or the result of cls(response)
9898
:rtype: ~azure.ai.anomalydetector.models.LastDetectResponse
@@ -104,7 +104,7 @@ async def last_detect(
104104
content_type = kwargs.pop("content_type", "application/json")
105105

106106
# Construct URL
107-
url = self.last_detect.metadata['url'] # type: ignore
107+
url = self.detect_last_point.metadata['url'] # type: ignore
108108
path_format_arguments = {
109109
'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
110110
}
@@ -119,7 +119,7 @@ async def last_detect(
119119
header_parameters['Accept'] = 'application/json'
120120

121121
body_content_kwargs = {} # type: Dict[str, Any]
122-
body_content = self._serialize.body(body, 'Request')
122+
body_content = self._serialize.body(body, 'DetectRequest')
123123
body_content_kwargs['content'] = body_content
124124
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
125125

@@ -128,7 +128,7 @@ async def last_detect(
128128

129129
if response.status_code not in [200]:
130130
map_error(status_code=response.status_code, response=response, error_map=error_map)
131-
error = self._deserialize(models.APIError, response)
131+
error = self._deserialize(models.AnomalyDetectorError, response)
132132
raise HttpResponseError(response=response, model=error)
133133

134134
deserialized = self._deserialize('LastDetectResponse', pipeline_response)
@@ -137,9 +137,9 @@ async def last_detect(
137137
return cls(pipeline_response, deserialized, {})
138138

139139
return deserialized
140-
last_detect.metadata = {'url': '/timeseries/last/detect'} # type: ignore
140+
detect_last_point.metadata = {'url': '/timeseries/last/detect'} # type: ignore
141141

142-
async def change_point_detect(
142+
async def detect_change_point(
143143
self,
144144
body: "models.ChangePointDetectRequest",
145145
**kwargs
@@ -162,7 +162,7 @@ async def change_point_detect(
162162
content_type = kwargs.pop("content_type", "application/json")
163163

164164
# Construct URL
165-
url = self.change_point_detect.metadata['url'] # type: ignore
165+
url = self.detect_change_point.metadata['url'] # type: ignore
166166
path_format_arguments = {
167167
'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
168168
}
@@ -186,7 +186,7 @@ async def change_point_detect(
186186

187187
if response.status_code not in [200]:
188188
map_error(status_code=response.status_code, response=response, error_map=error_map)
189-
error = self._deserialize(models.APIError, response)
189+
error = self._deserialize(models.AnomalyDetectorError, response)
190190
raise HttpResponseError(response=response, model=error)
191191

192192
deserialized = self._deserialize('ChangePointDetectResponse', pipeline_response)
@@ -195,4 +195,4 @@ async def change_point_detect(
195195
return cls(pipeline_response, deserialized, {})
196196

197197
return deserialized
198-
change_point_detect.metadata = {'url': '/timeseries/changePoint/detect'} # type: ignore
198+
detect_change_point.metadata = {'url': '/timeseries/changepoint/detect'} # type: ignore

sdk/anomalydetector/azure-ai-anomalydetector/azure/ai/anomalydetector/models/__init__.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,35 @@
77
# --------------------------------------------------------------------------
88

99
try:
10-
from ._models_py3 import APIError
10+
from ._models_py3 import AnomalyDetectorError
1111
from ._models_py3 import ChangePointDetectRequest
1212
from ._models_py3 import ChangePointDetectResponse
13+
from ._models_py3 import DetectRequest
1314
from ._models_py3 import EntireDetectResponse
1415
from ._models_py3 import LastDetectResponse
15-
from ._models_py3 import Point
16-
from ._models_py3 import Request
16+
from ._models_py3 import TimeSeriesPoint
1717
except (SyntaxError, ImportError):
18-
from ._models import APIError # type: ignore
18+
from ._models import AnomalyDetectorError # type: ignore
1919
from ._models import ChangePointDetectRequest # type: ignore
2020
from ._models import ChangePointDetectResponse # type: ignore
21+
from ._models import DetectRequest # type: ignore
2122
from ._models import EntireDetectResponse # type: ignore
2223
from ._models import LastDetectResponse # type: ignore
23-
from ._models import Point # type: ignore
24-
from ._models import Request # type: ignore
24+
from ._models import TimeSeriesPoint # type: ignore
2525

2626
from ._anomaly_detector_client_enums import (
2727
AnomalyDetectorErrorCodes,
28-
Granularity,
28+
TimeGranularity,
2929
)
3030

3131
__all__ = [
32-
'APIError',
32+
'AnomalyDetectorError',
3333
'ChangePointDetectRequest',
3434
'ChangePointDetectResponse',
35+
'DetectRequest',
3536
'EntireDetectResponse',
3637
'LastDetectResponse',
37-
'Point',
38-
'Request',
38+
'TimeSeriesPoint',
3939
'AnomalyDetectorErrorCodes',
40-
'Granularity',
40+
'TimeGranularity',
4141
]

sdk/anomalydetector/azure-ai-anomalydetector/azure/ai/anomalydetector/models/_anomaly_detector_client_enums.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AnomalyDetectorErrorCodes(with_metaclass(_CaseInsensitiveEnumMeta, str, En
4040
REQUIRED_GRANULARITY = "RequiredGranularity"
4141
REQUIRED_SERIES = "RequiredSeries"
4242

43-
class Granularity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
43+
class TimeGranularity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
4444
"""Can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is
4545
used for verify whether input series is valid.
4646
"""
@@ -50,5 +50,5 @@ class Granularity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
5050
WEEKLY = "weekly"
5151
DAILY = "daily"
5252
HOURLY = "hourly"
53-
MINUTELY = "minutely"
54-
SECONDLY = "secondly"
53+
PER_MINUTE = "minutely"
54+
PER_SECOND = "secondly"

0 commit comments

Comments
 (0)