Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
128 changes: 124 additions & 4 deletions sdk/synapse/azure-synapse-artifacts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,134 @@
# Release History

## 0.16.1 (Unreleased)
## 0.17.0 (2023-06-13)

### Features Added

### Breaking Changes
- Added operation group RunNotebookOperations
- Model Activity has a new parameter on_inactive_mark_as
- Model Activity has a new parameter state
- Model AmazonRdsForSqlServerLinkedService has a new parameter always_encrypted_settings
- Model AmazonRdsForSqlServerSource has a new parameter isolation_level
- Model AppendVariableActivity has a new parameter on_inactive_mark_as
- Model AppendVariableActivity has a new parameter state
- Model AzureBatchLinkedService has a new parameter credential
- Model AzureBlobFSLinkedService has a new parameter credential
- Model AzureBlobStorageLinkedService has a new parameter credential
- Model AzureDataExplorerCommandActivity has a new parameter on_inactive_mark_as
- Model AzureDataExplorerCommandActivity has a new parameter state
- Model AzureDataExplorerLinkedService has a new parameter credential
- Model AzureDataLakeStoreLinkedService has a new parameter credential
- Model AzureDatabricksDeltaLakeLinkedService has a new parameter credential
- Model AzureDatabricksLinkedService has a new parameter credential
- Model AzureFunctionActivity has a new parameter on_inactive_mark_as
- Model AzureFunctionActivity has a new parameter state
- Model AzureFunctionLinkedService has a new parameter authentication
- Model AzureFunctionLinkedService has a new parameter credential
- Model AzureFunctionLinkedService has a new parameter resource_id
- Model AzureKeyVaultLinkedService has a new parameter credential
- Model AzureMLBatchExecutionActivity has a new parameter on_inactive_mark_as
- Model AzureMLBatchExecutionActivity has a new parameter state
- Model AzureMLExecutePipelineActivity has a new parameter on_inactive_mark_as
- Model AzureMLExecutePipelineActivity has a new parameter state
- Model AzureMLLinkedService has a new parameter authentication
- Model AzureMLServiceLinkedService has a new parameter authentication
- Model AzureMLUpdateResourceActivity has a new parameter on_inactive_mark_as
- Model AzureMLUpdateResourceActivity has a new parameter state
- Model AzureSqlDWLinkedService has a new parameter credential
- Model AzureSqlDatabaseLinkedService has a new parameter always_encrypted_settings
- Model AzureSqlDatabaseLinkedService has a new parameter credential
- Model AzureSqlMILinkedService has a new parameter always_encrypted_settings
- Model AzureSqlMILinkedService has a new parameter credential
- Model AzureSqlSource has a new parameter isolation_level
- Model ControlActivity has a new parameter on_inactive_mark_as
- Model ControlActivity has a new parameter state
- Model CopyActivity has a new parameter on_inactive_mark_as
- Model CopyActivity has a new parameter state
- Model CosmosDbLinkedService has a new parameter credential
- Model CustomActivity has a new parameter on_inactive_mark_as
- Model CustomActivity has a new parameter state
- Model DataLakeAnalyticsUSQLActivity has a new parameter on_inactive_mark_as
- Model DataLakeAnalyticsUSQLActivity has a new parameter state
- Model DatabricksNotebookActivity has a new parameter on_inactive_mark_as
- Model DatabricksNotebookActivity has a new parameter state
- Model DatabricksSparkJarActivity has a new parameter on_inactive_mark_as
- Model DatabricksSparkJarActivity has a new parameter state
- Model DatabricksSparkPythonActivity has a new parameter on_inactive_mark_as
- Model DatabricksSparkPythonActivity has a new parameter state
- Model DeleteActivity has a new parameter on_inactive_mark_as
- Model DeleteActivity has a new parameter state
- Model DynamicsLinkedService has a new parameter credential
- Model ExecuteDataFlowActivity has a new parameter on_inactive_mark_as
- Model ExecuteDataFlowActivity has a new parameter state
- Model ExecutePipelineActivity has a new parameter on_inactive_mark_as
- Model ExecutePipelineActivity has a new parameter state
- Model ExecuteSSISPackageActivity has a new parameter on_inactive_mark_as
- Model ExecuteSSISPackageActivity has a new parameter state
- Model ExecutionActivity has a new parameter on_inactive_mark_as
- Model ExecutionActivity has a new parameter state
- Model FailActivity has a new parameter on_inactive_mark_as
- Model FailActivity has a new parameter state
- Model FilterActivity has a new parameter on_inactive_mark_as
- Model FilterActivity has a new parameter state
- Model ForEachActivity has a new parameter on_inactive_mark_as
- Model ForEachActivity has a new parameter state
- Model GetMetadataActivity has a new parameter on_inactive_mark_as
- Model GetMetadataActivity has a new parameter state
- Model HDInsightHiveActivity has a new parameter on_inactive_mark_as
- Model HDInsightHiveActivity has a new parameter state
- Model HDInsightMapReduceActivity has a new parameter on_inactive_mark_as
- Model HDInsightMapReduceActivity has a new parameter state
- Model HDInsightOnDemandLinkedService has a new parameter credential
- Model HDInsightPigActivity has a new parameter on_inactive_mark_as
- Model HDInsightPigActivity has a new parameter state
- Model HDInsightSparkActivity has a new parameter on_inactive_mark_as
- Model HDInsightSparkActivity has a new parameter state
- Model HDInsightStreamingActivity has a new parameter on_inactive_mark_as
- Model HDInsightStreamingActivity has a new parameter state
- Model IfConditionActivity has a new parameter on_inactive_mark_as
- Model IfConditionActivity has a new parameter state
- Model LinkConnectionTargetDatabaseTypeProperties has a new parameter action_on_existing_target_table
- Model LookupActivity has a new parameter on_inactive_mark_as
- Model LookupActivity has a new parameter state
- Model MongoDbAtlasLinkedService has a new parameter mongo_db_atlas_driver_version
- Model RestServiceLinkedService has a new parameter credential
- Model ScriptActivity has a new parameter on_inactive_mark_as
- Model ScriptActivity has a new parameter state
- Model SetVariableActivity has a new parameter on_inactive_mark_as
- Model SetVariableActivity has a new parameter state
- Model SqlDWSource has a new parameter isolation_level
- Model SqlMISource has a new parameter isolation_level
- Model SqlPoolStoredProcedureActivity has a new parameter on_inactive_mark_as
- Model SqlPoolStoredProcedureActivity has a new parameter state
- Model SqlServerLinkedService has a new parameter always_encrypted_settings
- Model SqlServerSource has a new parameter isolation_level
- Model SqlServerStoredProcedureActivity has a new parameter on_inactive_mark_as
- Model SqlServerStoredProcedureActivity has a new parameter state
- Model SwitchActivity has a new parameter on_inactive_mark_as
- Model SwitchActivity has a new parameter state
- Model SynapseNotebookActivity has a new parameter configuration_type
- Model SynapseNotebookActivity has a new parameter on_inactive_mark_as
- Model SynapseNotebookActivity has a new parameter spark_config
- Model SynapseNotebookActivity has a new parameter state
- Model SynapseNotebookActivity has a new parameter target_spark_configuration
- Model SynapseSparkJobDefinitionActivity has a new parameter on_inactive_mark_as
- Model SynapseSparkJobDefinitionActivity has a new parameter state
- Model UntilActivity has a new parameter on_inactive_mark_as
- Model UntilActivity has a new parameter state
- Model ValidationActivity has a new parameter on_inactive_mark_as
- Model ValidationActivity has a new parameter state
- Model WaitActivity has a new parameter on_inactive_mark_as
- Model WaitActivity has a new parameter state
- Model WebActivity has a new parameter on_inactive_mark_as
- Model WebActivity has a new parameter state
- Model WebActivityAuthentication has a new parameter credential
- Model WebActivityAuthentication has a new parameter user_tenant
- Model WebHookActivity has a new parameter on_inactive_mark_as
- Model WebHookActivity has a new parameter state

### Bugs Fixed
### Breaking Changes

### Other Changes
- Model Notebook no longer has parameter target_spark_configuration

## 0.16.0 (2023-05-12)

Expand Down
8 changes: 4 additions & 4 deletions sdk/synapse/azure-synapse-artifacts/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
recursive-include tests *.py *.json
recursive-include samples *.py *.md
include *.md
include azure/__init__.py
include azure/synapse/__init__.py
include LICENSE
include azure/synapse/artifacts/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include azure/__init__.py
include azure/synapse/__init__.py
45 changes: 42 additions & 3 deletions sdk/synapse/azure-synapse-artifacts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,50 @@ For a more complete view of Azure libraries, see the [azure sdk python release](

_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_

# Usage
## Getting started

For code examples, see [Synapse Artifacts](https://docs.microsoft.com/python/api/overview/azure/) on docs.microsoft.com.
### Prerequisites

# Provide Feedback
- Python 3.7+ is required to use this package.
- [Azure subscription](https://azure.microsoft.com/free/)

### Install the package

```bash
pip install azure-synapse-artifacts
pip install azure-identity
```

### Authentication

By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` for Azure client secret.

With above configuration, client can be authenticated by following code:

```python
import os
from azure.identity import DefaultAzureCredential
from azure.synapse.artifacts import ArtifactsClient

endpoint = os.environ["SYNAPSE_ARTIFACTS_ENDPOINT"]
client = ArtifactsClient(endpoint=endpoint, credential=DefaultAzureCredential())
```

## Examples

Code samples for this package can be found at:
- [Search Synapse Artifacts](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com


## Troubleshooting

## Next steps

## Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from ._configuration import ArtifactsClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
ArtifactsClientOperationsMixin,
BigDataPoolsOperations,
DataFlowDebugSessionOperations,
DataFlowOperations,
Expand All @@ -31,6 +32,7 @@
NotebookOperations,
PipelineOperations,
PipelineRunOperations,
RunNotebookOperations,
SparkConfigurationOperations,
SparkJobDefinitionOperations,
SqlPoolsOperations,
Expand All @@ -46,11 +48,15 @@
from azure.core.credentials import TokenCredential


class ArtifactsClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""ArtifactsClient.
class ArtifactsClient(
ArtifactsClientOperationsMixin
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""SyMS API Service Client.
Comment thread
msyyc marked this conversation as resolved.
Outdated

:ivar link_connection: LinkConnectionOperations operations
:vartype link_connection: azure.synapse.artifacts.operations.LinkConnectionOperations
:ivar run_notebook: RunNotebookOperations operations
:vartype run_notebook: azure.synapse.artifacts.operations.RunNotebookOperations
:ivar kql_scripts: KqlScriptsOperations operations
:vartype kql_scripts: azure.synapse.artifacts.operations.KqlScriptsOperations
:ivar kql_script: KqlScriptOperations operations
Expand Down Expand Up @@ -103,20 +109,26 @@ class ArtifactsClient: # pylint: disable=client-accepts-api-version-keyword,too
:param endpoint: The workspace development endpoint, for example
https://myworkspace.dev.azuresynapse.net. Required.
:type endpoint: str
:param user_agent_parameter: User-Agent request header for servers to identify application.
Required.
:type user_agent_parameter: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""

def __init__(self, credential: "TokenCredential", endpoint: str, **kwargs: Any) -> None:
def __init__(self, credential: "TokenCredential", endpoint: str, user_agent_parameter: str, **kwargs: Any) -> None:
Comment thread
msyyc marked this conversation as resolved.
Outdated
_endpoint = "{endpoint}"
self._config = ArtifactsClientConfiguration(credential=credential, endpoint=endpoint, **kwargs)
self._config = ArtifactsClientConfiguration(
credential=credential, endpoint=endpoint, user_agent_parameter=user_agent_parameter, **kwargs
)
self._client: PipelineClient = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.link_connection = LinkConnectionOperations(self._client, self._config, self._serialize, self._deserialize)
self.run_notebook = RunNotebookOperations(self._client, self._config, self._serialize, self._deserialize)
self.kql_scripts = KqlScriptsOperations(self._client, self._config, self._serialize, self._deserialize)
self.kql_script = KqlScriptOperations(self._client, self._config, self._serialize, self._deserialize)
self.metastore = MetastoreOperations(self._client, self._config, self._serialize, self._deserialize)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ class ArtifactsClientConfiguration(Configuration): # pylint: disable=too-many-i
:param endpoint: The workspace development endpoint, for example
https://myworkspace.dev.azuresynapse.net. Required.
:type endpoint: str
:param user_agent_parameter: User-Agent request header for servers to identify application.
Required.
:type user_agent_parameter: str
"""

def __init__(self, credential: "TokenCredential", endpoint: str, **kwargs: Any) -> None:
def __init__(self, credential: "TokenCredential", endpoint: str, user_agent_parameter: str, **kwargs: Any) -> None:
super(ArtifactsClientConfiguration, self).__init__(**kwargs)
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
if user_agent_parameter is None:
raise ValueError("Parameter 'user_agent_parameter' must not be None.")

self.credential = credential
self.endpoint = endpoint
self.user_agent_parameter = user_agent_parameter
self.credential_scopes = kwargs.pop("credential_scopes", ["https://dev.azuresynapse.net/.default"])
kwargs.setdefault("sdk_moniker", "synapse-artifacts/{}".format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import List, cast
from abc import ABC
from typing import List, TYPE_CHECKING, cast

from azure.core.pipeline.transport import HttpRequest

from ._configuration import ArtifactsClientConfiguration

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core import PipelineClient

from ._serialization import Deserializer, Serializer


def _convert_request(request, files=None):
data = request.content if not files else None
Expand All @@ -28,3 +37,12 @@ def _format_url_section(template, **kwargs):
formatted_components = cast(List[str], template.split("/"))
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
template = "/".join(components)


class ArtifactsClientMixinABC(ABC):
"""DO NOT use this class. It is for internal typing use only."""

_client: "PipelineClient"
_config: ArtifactsClientConfiguration
_serialize: "Serializer"
_deserialize: "Deserializer"
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "0.16.1"
VERSION = "0.17.0"
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from .._serialization import Deserializer, Serializer
from ._configuration import ArtifactsClientConfiguration
from .operations import (
ArtifactsClientOperationsMixin,
BigDataPoolsOperations,
DataFlowDebugSessionOperations,
DataFlowOperations,
Expand All @@ -31,6 +32,7 @@
NotebookOperations,
PipelineOperations,
PipelineRunOperations,
RunNotebookOperations,
SparkConfigurationOperations,
SparkJobDefinitionOperations,
SqlPoolsOperations,
Expand All @@ -46,11 +48,15 @@
from azure.core.credentials_async import AsyncTokenCredential


class ArtifactsClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""ArtifactsClient.
class ArtifactsClient(
ArtifactsClientOperationsMixin
): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""SyMS API Service Client.

:ivar link_connection: LinkConnectionOperations operations
:vartype link_connection: azure.synapse.artifacts.aio.operations.LinkConnectionOperations
:ivar run_notebook: RunNotebookOperations operations
:vartype run_notebook: azure.synapse.artifacts.aio.operations.RunNotebookOperations
:ivar kql_scripts: KqlScriptsOperations operations
:vartype kql_scripts: azure.synapse.artifacts.aio.operations.KqlScriptsOperations
:ivar kql_script: KqlScriptOperations operations
Expand Down Expand Up @@ -106,20 +112,28 @@ class ArtifactsClient: # pylint: disable=client-accepts-api-version-keyword,too
:param endpoint: The workspace development endpoint, for example
https://myworkspace.dev.azuresynapse.net. Required.
:type endpoint: str
:param user_agent_parameter: User-Agent request header for servers to identify application.
Required.
:type user_agent_parameter: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
"""

def __init__(self, credential: "AsyncTokenCredential", endpoint: str, **kwargs: Any) -> None:
def __init__(
self, credential: "AsyncTokenCredential", endpoint: str, user_agent_parameter: str, **kwargs: Any
) -> None:
_endpoint = "{endpoint}"
self._config = ArtifactsClientConfiguration(credential=credential, endpoint=endpoint, **kwargs)
self._config = ArtifactsClientConfiguration(
credential=credential, endpoint=endpoint, user_agent_parameter=user_agent_parameter, **kwargs
)
self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, config=self._config, **kwargs)

client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.link_connection = LinkConnectionOperations(self._client, self._config, self._serialize, self._deserialize)
self.run_notebook = RunNotebookOperations(self._client, self._config, self._serialize, self._deserialize)
self.kql_scripts = KqlScriptsOperations(self._client, self._config, self._serialize, self._deserialize)
self.kql_script = KqlScriptOperations(self._client, self._config, self._serialize, self._deserialize)
self.metastore = MetastoreOperations(self._client, self._config, self._serialize, self._deserialize)
Expand Down
Loading