Skip to content

[Synapse] Fix deserialization issue for creating Pipeline/Dataset/Trigger #13643

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

Merged
merged 7 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions src/Synapse/Synapse/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@
- Additional information about change #1
-->
## Upcoming Release
* Added support for operation of Advanced Threat Protection settings in SqlPool-level
- Add `Update-AzSynapseSqlPoolAdvancedThreatProtectionSetting` cmdlet
- Add `Get-AzSynapseSqlPoolAdvancedThreatProtectionSetting` cmdlet
- Add `Reset-AzSynapseSqlPoolAdvancedThreatProtectionSetting` cmdlet
* Added support for operation of Vulnerability Assessment settings in SqlPool-level
- Add `Update-AzSynapseSqlPoolVulnerabilityAssessmentSetting` cmdlet
- Add `Get-AzSynapseSqlPoolVulnerabilityAssessmentSetting` cmdlet
- Add `Reset-AzSynapseSqlPoolVulnerabilityAssessmentSetting` cmdlet
* Added support for operation of SQL Advanced Data Security
- Add `Enable-AzSynapseSqlAdvancedDataSecurity` cmdlet
- Add `Disable-AzSynapseSqlAdvancedDataSecurity` cmdlet
- Add `Get-AzSynapseSqlAdvancedDataSecurityPolicy` cmdlet
* Added support for operation of Transparent Data Encryption in SqlPool-level
- Add `Get-AzSynapseSqlPoolTransparentDataEncryption` cmdlet
- Add `Set-AzSynapseSqlPoolTransparentDataEncryption` cmdlet
* Fixed deserialization error when create Pipeline/Dataset/Trigger through DefinitionFile

## Version 0.5.0
* Added support for operation of Synapse SQL Pool Restore Point
Expand All @@ -30,32 +46,19 @@
- Add `Set-AzSynapseSqlPoolAuditSetting` cmdlet
- Add `Get-AzSynapseSqlPoolAuditSetting` cmdlet
- Add `Reset-AzSynapseSqlPoolAuditSetting` cmdlet
* Added support for operation of Advanced Threat Protection settings in Workspace-level and SqlPool-level
* Added support for operation of Advanced Threat Protection settings in Workspace-level
- Add `Update-AzSynapseSqlAdvancedThreatProtectionSetting` cmdlet
- Add `Get-AzSynapseSqlAdvancedThreatProtectionSetting` cmdlet
- Add `Reset-AzSynapseSqlAdvancedThreatProtectionSetting` cmdlet
- Add `Update-AzSynapseSqlPoolAdvancedThreatProtectionSetting` cmdlet
- Add `Get-AzSynapseSqlPoolAdvancedThreatProtectionSetting` cmdlet
- Add `Reset-AzSynapseSqlPoolAdvancedThreatProtectionSetting` cmdlet
* Added support for operation of Vulnerability Assessment settings in Workspace-level and SqlPool-level
* Added support for operation of Vulnerability Assessment settings in Workspace-level
- Add `Update-AzSynapseSqlVulnerabilityAssessmentSetting` cmdlet
- Add `Get-AzSynapseSqlVulnerabilityAssessmentSetting` cmdlet
- Add `Reset-AzSynapseSqlVulnerabilityAssessmentSetting` cmdlet
- Add `Update-AzSynapseSqlPoolVulnerabilityAssessmentSetting` cmdlet
- Add `Get-AzSynapseSqlPoolVulnerabilityAssessmentSetting` cmdlet
- Add `Reset-AzSynapseSqlPoolVulnerabilityAssessmentSetting` cmdlet
* Added support for operation of SQL Active Directory admin
- Add `Set-AzSynapseSqlActiveDirectoryAdministrator` cmdlet
- Add `Get-AzSynapseSqlActiveDirectoryAdministrator` cmdlet
- Add `Remove-AzSynapseSqlActiveDirectoryAdministrator` cmdlet
* Fixed Null Reference Exception when submit spark job.
* Added support for operation of SQL Advanced Data Security
- Add `Enable-AzSynapseSqlAdvancedDataSecurity` cmdlet
- Add `Disable-AzSynapseSqlAdvancedDataSecurity` cmdlet
- Add `Get-AzSynapseSqlAdvancedDataSecurityPolicy` cmdlet
* Added support for operation of Transparent Data Encryption in SqlPool-level
- Add `Get-AzSynapseSqlPoolTransparentDataEncryption` cmdlet
- Add `Set-AzSynapseSqlPoolTransparentDataEncryption` cmdlet

## Version 0.4.0
* Add `-Force` to all Remove cmdlets
Expand Down
44 changes: 44 additions & 0 deletions src/Synapse/Synapse/Models/Activity/PSActivityPolicy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Azure.Analytics.Synapse.Artifacts.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.Synapse.Models
{
public class PSActivityPolicy
{
public PSActivityPolicy() { }

[JsonProperty(PropertyName = "timeout")]
public object Timeout { get; set; }

[JsonProperty(PropertyName = "retry")]
public object Retry { get; set; }

[JsonProperty(PropertyName = "retryIntervalInSeconds")]
public int? RetryIntervalInSeconds { get; set; }

[JsonProperty(PropertyName = "secureInput")]
public bool? SecureInput { get; set; }

[JsonProperty(PropertyName = "secureOutput")]
public bool? SecureOutput { get; set; }

[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }

public ActivityPolicy ToSdkObject()
{
var policy = new ActivityPolicy()
{
Timeout = this.Timeout,
Retry = this.Retry,
RetryIntervalInSeconds = this.RetryIntervalInSeconds,
SecureInput = this.SecureInput,
SecureOutput = this.SecureOutput
};
this.AdditionalProperties?.ForEach(item => policy.Add(item.Key, item.Value));
return policy;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public override Activity ToSdkObject()
var activity = new AzureDataExplorerCommandActivity(this.Name, this.Command);
activity.CommandTimeout = this.CommandTimeout;
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public override Activity ToSdkObject()
activity.Headers = this.Headers;
activity.Body = this.Body;
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public override Activity ToSdkObject()
this.WebServiceOutputs?.ForEach(item => activity.WebServiceOutputs.Add(item));
this.WebServiceInputs?.ForEach(item => activity.WebServiceInputs.Add(item));
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public override Activity ToSdkObject()
activity.MlParentRunId = this.MlParentRunId;
activity.ContinueOnStepFailure = this.ContinueOnStepFailure;
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public override Activity ToSdkObject()
{
var activity = new AzureMLUpdateResourceActivity(this.Name, this.TrainedModelName, this.TrainedModelLinkedServiceName, this.TrainedModelFilePath);
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
16 changes: 8 additions & 8 deletions src/Synapse/Synapse/Models/Activity/PSCopyActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public PSCopyActivity()
/// Gets or sets copy activity source.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.source")]
public CopySource Source { get; set; }
public PSCopySource Source { get; set; }

/// <summary>
/// Gets or sets copy activity sink.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.sink")]
public CopySink Sink { get; set; }
public PSCopySink Sink { get; set; }

/// <summary>
/// Gets or sets copy activity translator. If not specified, tabular
Expand All @@ -71,7 +71,7 @@ public PSCopyActivity()
/// is true.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.stagingSettings")]
public StagingSettings StagingSettings { get; set; }
public PSStagingSettings StagingSettings { get; set; }

/// <summary>
/// Gets or sets maximum number of concurrent sessions opened on the
Expand Down Expand Up @@ -101,7 +101,7 @@ public PSCopyActivity()
/// EnableSkipIncompatibleRow is true.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.redirectIncompatibleRowSettings")]
public RedirectIncompatibleRowSettings RedirectIncompatibleRowSettings { get; set; }
public PSRedirectIncompatibleRowSettings RedirectIncompatibleRowSettings { get; set; }

/// <summary>
/// Gets or sets preserve Rules.
Expand Down Expand Up @@ -148,20 +148,20 @@ public override void Validate()

public override Activity ToSdkObject()
{
var activity = new CopyActivity(this.Name, this.Source, this.Sink);
var activity = new CopyActivity(this.Name, this.Source?.ToSdkObject(), this.Sink?.ToSdkObject());
this.Inputs?.ForEach(item => activity.Inputs.Add(item));
this.Outputs?.ForEach(item => activity.Outputs.Add(item));
activity.Translator = this.Translator;
activity.EnableStaging = this.EnableStaging;
activity.StagingSettings = this.StagingSettings;
activity.StagingSettings = this.StagingSettings?.ToSdkObject();
activity.ParallelCopies = this.ParallelCopies;
activity.DataIntegrationUnits = this.DataIntegrationUnits;
activity.EnableSkipIncompatibleRow = this.EnableSkipIncompatibleRow;
activity.RedirectIncompatibleRowSettings = this.RedirectIncompatibleRowSettings;
activity.RedirectIncompatibleRowSettings = this.RedirectIncompatibleRowSettings?.ToSdkObject();
this.PreserveRules?.ForEach(item => activity.PreserveRules.Add(item));
this.Preserve?.ForEach(item => activity.Preserve.Add(item));
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
44 changes: 44 additions & 0 deletions src/Synapse/Synapse/Models/Activity/PSCopySink.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Azure.Analytics.Synapse.Artifacts.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.Synapse.Models
{
public class PSCopySink
{
public PSCopySink() { }

[JsonProperty(PropertyName = "writeBatchSize")]
public object WriteBatchSize { get; set; }

[JsonProperty(PropertyName = "writeBatchTimeout")]
public object WriteBatchTimeout { get; set; }

[JsonProperty(PropertyName = "sinkRetryCount")]
public object SinkRetryCount { get; set; }

[JsonProperty(PropertyName = "sinkRetryWait")]
public object SinkRetryWait { get; set; }

[JsonProperty(PropertyName = "maxConcurrentConnections")]
public object MaxConcurrentConnections { get; set; }

[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }

public CopySink ToSdkObject()
{
var copySink = new CopySink()
{
WriteBatchSize = this.WriteBatchSize,
WriteBatchTimeout = this.WriteBatchTimeout,
SinkRetryCount = this.SinkRetryCount,
SinkRetryWait = this.SinkRetryWait,
MaxConcurrentConnections = this.MaxConcurrentConnections
};
this.AdditionalProperties?.ForEach(item => copySink.Add(item.Key, item.Value));
return copySink;
}
}
}
36 changes: 36 additions & 0 deletions src/Synapse/Synapse/Models/Activity/PSCopySource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Azure.Analytics.Synapse.Artifacts.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.Synapse.Models
{
public class PSCopySource
{
public PSCopySource() { }

[JsonProperty(PropertyName = "sourceRetryCount")]
public object SourceRetryCount { get; set; }

[JsonProperty(PropertyName = "sourceRetryWait")]
public object SourceRetryWait { get; set; }

[JsonProperty(PropertyName = "maxConcurrentConnections")]
public object MaxConcurrentConnections { get; set; }

[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }

public CopySource ToSdkObject()
{
var copySource = new CopySource()
{
SourceRetryCount = this.SourceRetryCount,
SourceRetryWait = this.SourceRetryWait,
MaxConcurrentConnections = this.MaxConcurrentConnections
};
this.AdditionalProperties?.ForEach(item => copySource.Add(item.Key, item.Value));
return copySource;
}
}
}
2 changes: 1 addition & 1 deletion src/Synapse/Synapse/Models/Activity/PSCustomActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public override Activity ToSdkObject()
this.ExtendedProperties?.ForEach(item => activity.ExtendedProperties.Add(item));
activity.RetentionTimeInDays = this.RetentionTimeInDays;
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
34 changes: 34 additions & 0 deletions src/Synapse/Synapse/Models/Activity/PSDataFlowReference.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Azure.Analytics.Synapse.Artifacts.Models;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Newtonsoft.Json;
using System.Collections.Generic;

namespace Microsoft.Azure.Commands.Synapse.Models
{
public class PSDataFlowReference
{
public PSDataFlowReference() { }

[JsonProperty(PropertyName = "type")]
public DataFlowReferenceType? Type { get; set; }

[JsonProperty(PropertyName = "referenceName")]
public string ReferenceName { get; set; }

[JsonProperty(PropertyName = "datasetParameters")]
public object DatasetParameters { get; set; }

[JsonExtensionData]
public IDictionary<string, object> AdditionalProperties { get; set; }

public DataFlowReference ToSdkObject()
{
var dataFlowReference = new DataFlowReference(this.Type.GetValueOrDefault(), this.ReferenceName)
{
DatasetParameters = this.DatasetParameters
};
this.AdditionalProperties?.ForEach(item => dataFlowReference.Add(item.Key, item.Value));
return dataFlowReference;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public override Activity ToSdkObject()
activity.RuntimeVersion = this.RuntimeVersion;
activity.CompilationMode = this.CompilationMode;
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public override Activity ToSdkObject()
this.BaseParameters?.ForEach(item => activity.BaseParameters.Add(item));
this.Libraries?.ForEach(item => activity.Libraries.Add(item));
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public override Activity ToSdkObject()
this.Parameters?.ForEach(item => activity.Parameters.Add(item));
this.Libraries?.ForEach(item => activity.Libraries.Add(item));
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public override Activity ToSdkObject()
this.Parameters?.ForEach(item => activity.Parameters.Add(item));
this.Libraries?.ForEach(item => activity.Libraries.Add(item));
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Synapse/Synapse/Models/Activity/PSDeleteActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public PSDeleteActivity()
/// enableLogging is true.
/// </summary>
[JsonProperty(PropertyName = "typeProperties.logStorageSettings")]
public LogStorageSettings LogStorageSettings { get; set; }
public PSLogStorageSettings LogStorageSettings { get; set; }

/// <summary>
/// Gets or sets delete activity dataset reference.
Expand Down Expand Up @@ -99,9 +99,9 @@ public override Activity ToSdkObject()
activity.Recursive = this.Recursive;
activity.MaxConcurrentConnections = this.MaxConcurrentConnections;
activity.EnableLogging = this.EnableLogging;
activity.LogStorageSettings = this.LogStorageSettings;
activity.LogStorageSettings = this.LogStorageSettings?.ToSdkObject();
activity.LinkedServiceName = this.LinkedServiceName;
activity.Policy = this.Policy;
activity.Policy = this.Policy?.ToSdkObject();
SetProperties(activity);
return activity;
}
Expand Down
Loading