Skip to content

Commit

Permalink
Merge branch 'master' into ilmat/fix-seed
Browse files Browse the repository at this point in the history
  • Loading branch information
imatiach-msft authored Mar 22, 2022
2 parents 713f197 + f11563b commit c2e9a57
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ trait MADHttpRequest extends HasURL with HasSubscriptionKey with HasAsyncReply {
s"Querying for results did not complete within $maxTries tries")
}
} else {
response
val error = IOUtils.toString(response.entity.get.content, "UTF-8")
.parseJson.convertTo[DMAError].toJson.compactPrint
throw new RuntimeException(s"Caught error: $error")
}
}
}
Expand Down Expand Up @@ -464,6 +466,7 @@ class DetectMultivariateAnomaly(override val uid: String) extends Model[DetectMu

protected def prepareUrl: String = getUrl + s"${getModelId}/detect"

//noinspection ScalaStyle
override def transform(dataset: Dataset[_]): DataFrame = {
logTransform[DataFrame] {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,38 @@ class FitMultivariateAnomalySuite extends EstimatorFuzzing[FitMultivariateAnomal
assert(caught.getMessage.contains("Not enough data."))
}

test("Expose correct error message for invalid Timestamp Format") {
val caught = intercept[RuntimeException] {
val smae = simpleMultiAnomalyEstimator
.setEndTime("FAKE_END_TIME")
.setSlidingWindow(200)
.setConnectionString(connectionString)
smae.fit(df)
}
assert(caught.getMessage.contains("InvalidTimestampFormat"))
}

test("Expose correct error message for invalid modelId") {
val caught = intercept[RuntimeException] {
val detectMultivariateAnomaly = new DetectMultivariateAnomaly()
.setModelId("FAKE_MODEL_ID")
.setConnectionString(connectionString)
.setSubscriptionKey(anomalyKey)
.setLocation("westus2")
.setContainerName(containerName)
.setIntermediateSaveDir(intermediateSaveDir)
detectMultivariateAnomaly
.setStartTime(startTime)
.setEndTime(endTime)
.setOutputCol("result")
.setTimestampCol(timestampColumn)
.setInputCols(inputColumns)
.transform(df)
.collect()
}
assert(caught.getMessage.contains("ModelNotExist"))
}

override def testSerialization(): Unit = {
println("ignore the Serialization Fuzzing test because fitting process takes more than 3 minutes")
}
Expand Down
74 changes: 37 additions & 37 deletions pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,43 +115,43 @@ jobs:
failTaskOnFailedTests: true
condition: and(eq(variables.runTests, 'True'), succeededOrFailed())

- job: SynapseE2E
timeoutInMinutes: 120
cancelTimeoutInMinutes: 0
pool:
vmImage: ubuntu-18.04
steps:
# - template: templates/ivy_cache.yml
- template: templates/update_cli.yml
- template: templates/conda.yml
- template: templates/kv.yml
- bash: |
set -e
source activate synapseml
jupyter nbconvert --to script ./notebooks/features/*/*.ipynb*
sbt packagePython
sbt publishBlob
displayName: Publish Blob Artifacts
env:
STORAGE-KEY: $(storage-key)
NEXUS-UN: $(nexus-un)
NEXUS-PW: $(nexus-pw)
PGP-PRIVATE: $(pgp-private)
PGP-PUBLIC: $(pgp-public)
PGP-PW: $(pgp-pw)
- task: AzureCLI@1
displayName: 'E2E'
inputs:
azureSubscription: 'MMLSpark Build'
scriptLocation: inlineScript
inlineScript: 'sbt "testOnly com.microsoft.azure.synapse.ml.nbtest.SynapseTests"'
condition: and(succeeded(), eq(variables.runTests, 'True'))
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**/test-reports/TEST-*.xml'
failTaskOnFailedTests: true
condition: and(eq(variables.runTests, 'True'), succeededOrFailed())
# - job: SynapseE2E
# timeoutInMinutes: 120
# cancelTimeoutInMinutes: 0
# pool:
# vmImage: ubuntu-18.04
# steps:
# # - template: templates/ivy_cache.yml
# - template: templates/update_cli.yml
# - template: templates/conda.yml
# - template: templates/kv.yml
# - bash: |
# set -e
# source activate synapseml
# jupyter nbconvert --to script ./notebooks/features/*/*.ipynb*
# sbt packagePython
# sbt publishBlob
# displayName: Publish Blob Artifacts
# env:
# STORAGE-KEY: $(storage-key)
# NEXUS-UN: $(nexus-un)
# NEXUS-PW: $(nexus-pw)
# PGP-PRIVATE: $(pgp-private)
# PGP-PUBLIC: $(pgp-public)
# PGP-PW: $(pgp-pw)
# - task: AzureCLI@1
# displayName: 'E2E'
# inputs:
# azureSubscription: 'MMLSpark Build'
# scriptLocation: inlineScript
# inlineScript: 'sbt "testOnly com.microsoft.azure.synapse.ml.nbtest.SynapseTests"'
# condition: and(succeeded(), eq(variables.runTests, 'True'))
# - task: PublishTestResults@2
# displayName: 'Publish Test Results'
# inputs:
# testResultsFiles: '**/test-reports/TEST-*.xml'
# failTaskOnFailedTests: true
# condition: and(eq(variables.runTests, 'True'), succeededOrFailed())

- job: PublishDocker
displayName: PublishDocker
Expand Down

0 comments on commit c2e9a57

Please sign in to comment.