Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.6k stars 2.82k forks source link

Raise an Error when successfully start synapse pipeline using create_pipeline_run method #36907

Open agustin-mazzeo-glb opened 2 months ago

agustin-mazzeo-glb commented 2 months ago

Describe the bug When you create a pipeline run execution in Azure Synapse, you get an error. However, if you check the log or the error variable, you can see that the status code was 202 and in Azure Synapse the pipeline is running.

To Reproduce Steps to reproduce the behavior: This is the code to reproduce the error:

1 - Import libraries

from azure.synapse.artifacts import ArtifactsClient from azure.synapse.artifacts.models import CreateRunResponse from azure.synapse.artifacts.models import CreateRunResponse from azure.core.exceptions import HttpResponseError

2 - Set Variables according a to azure environment and azure resources.

subscription_id = 'XXXXXX' synapse_workspace_name = 'YYYYYY' pipeline_name = 'AAAAA' tenant_id = 'VVVVVVV' client_id = 'ZZZZZZ' client_secret = 'FFFFFFF'

3 - Define Main Code

def main_synapse():

Set Crendential

    credential = ClientSecretCredential(
        tenant_id=tenant_id,
        client_id=client_id,
        client_secret=client_secret
    )
   # Set  pipeline parameters (Optional)
    pipeline_parameters_dict = {
        'p_message': 'Hello World!'
    }
    # Create Synapse Client
    artifacts_client = ArtifactsClient(endpoint=f"https://{synapse_workspace_name}.dev.azuresynapse.net", credential=credential)

    # Create synapse pipeline execution
    response = artifacts_client.pipeline.create_pipeline_run(
            pipeline_name=pipeline_name,
            parameters=pipeline_parameters_dict
    )

if name == 'main': main_synapse()

Expected behavior If there are no issues or errors, the expected output will be not receive an exception error, and the response variable will be set with the correct API's answer.

Note: I checked the library code I found that the code only consider the status code of 200 and not the 202.

Screenshots If applicable, add screenshots to help explain your problem.

Azure Library Screenshot

image

Evidence Error Screenshot - Terminal

image

Evidence Error Screenshot - Debug Console

image

Additional context

github-actions[bot] commented 2 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @wonner @zesluo.