Skip to content

Commit 64dffa4

Browse files
kevinzz6CustardTart32
authored andcommitted
{Synapse} Update azure synapse artifact version to 0.20.0 and spark to 0.7.0 (Azure#30875)
* update spark version update artifact version * update test record * fix error * enable spark client credential_scopes
1 parent 57d8324 commit 64dffa4

8 files changed

+167
-468
lines changed

src/azure-cli/azure/cli/command_modules/synapse/manual/_client_factory.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ def cf_kusto_pool(cli_ctx, *_):
105105
def synapse_spark_factory(cli_ctx, workspace_name, sparkpool_name):
106106
from azure.synapse.spark import SparkClient
107107
from azure.cli.core._profile import Profile
108-
# Uncomment this line after SparkClient is fixed. See https://github.com/Azure/azure-cli/pull/30788
109-
# from azure.cli.core.auth.util import resource_to_scopes
108+
from azure.cli.core.auth.util import resource_to_scopes
110109
from azure.cli.core.commands.client_factory import get_subscription_id
111110
subscription_id = get_subscription_id(cli_ctx)
112111
profile = Profile(cli_ctx=cli_ctx)
@@ -115,8 +114,7 @@ def synapse_spark_factory(cli_ctx, workspace_name, sparkpool_name):
115114
credential=cred,
116115
endpoint='{}{}{}'.format("https://", workspace_name, cli_ctx.cloud.suffixes.synapse_analytics_endpoint),
117116
spark_pool_name=sparkpool_name,
118-
# Uncomment this line after SparkClient is fixed
119-
# credential_scopes=resource_to_scopes(cli_ctx.cloud.endpoints.synapse_analytics_resource_id)
117+
credential_scopes=resource_to_scopes(cli_ctx.cloud.endpoints.synapse_analytics_resource_id)
120118
)
121119

122120

src/azure-cli/azure/cli/command_modules/synapse/tests/latest/recordings/test_spark_job.yaml

+48-216
Large diffs are not rendered by default.

src/azure-cli/azure/cli/command_modules/synapse/tests/latest/recordings/test_spark_session_and_statements.yaml

+100-228
Large diffs are not rendered by default.

src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py

+9-12
Original file line numberDiff line numberDiff line change
@@ -2038,15 +2038,15 @@ def test_ip_firewall_rules(self, resource_group, storage_account):
20382038
@ResourceGroupPreparer(name_prefix='synapse-cli', random_name_length=16)
20392039
def test_spark_job(self, resource_group):
20402040
self.kwargs.update({
2041-
'spark-pool': 'testsparkpool',
2042-
'workspace': 'testsynapseworkspace',
2041+
'spark-pool': 'sparkpooltest',
2042+
'workspace': 'yanjuntestws001',
20432043
'job': 'WordCount_Java',
2044-
'main-definition-file': 'abfss://testfilesystem@adlsgen2account.dfs.core.windows.net/samples/java/wordcount/wordcount.jar',
2044+
'main-definition-file': 'abfss://filesystem01@ywtestaccount.dfs.core.windows.net/wordcount/wordcount_2.11-0.1.jar',
20452045
'main-class-name': 'WordCount',
20462046
'arguments': [
2047-
'abfss://testfilesystem@adlsgen2account.dfs.core.windows.net/samples/java/wordcount/shakespeare.txt',
2048-
'abfss://testfilesystem@adlsgen2account.dfs.core.windows.net/samples/java/wordcount/result/'],
2049-
'executors': 2,
2047+
'abfss://filesystem01@ywtestaccount.dfs.core.windows.net/wordcount/input/shakespeare.txt',
2048+
'abfss://filesystem01@ywtestaccount.dfs.core.windows.net/wordcount/output/'],
2049+
'executors': 4,
20502050
'executor-size': 'Medium',
20512051
'configuration': '{\\"spark.dynamicAllocation.maxExecutors\\":\\"18\\"}'
20522052
})
@@ -2091,8 +2091,8 @@ def test_spark_job(self, resource_group):
20912091
@ResourceGroupPreparer(name_prefix='synapse-cli', random_name_length=16)
20922092
def test_spark_session_and_statements(self, resource_group):
20932093
self.kwargs.update({
2094-
'spark-pool': 'testsparkpool',
2095-
'workspace': 'testsynapseworkspace',
2094+
'spark-pool': 'sparkpooltest',
2095+
'workspace': 'yanjuntestws001',
20962096
'job': self.create_random_name(prefix='clisession', length=14),
20972097
'executor-size': 'Small',
20982098
'executors': 2,
@@ -2161,10 +2161,7 @@ def test_spark_session_and_statements(self, resource_group):
21612161

21622162
# cancel a spark session statement
21632163
self.cmd('az synapse spark statement cancel --livy-id {statement-id} --session-id {session-id} '
2164-
'--workspace-name {workspace} --spark-pool-name {spark-pool} --yes',
2165-
checks=[
2166-
self.check('msg', 'canceled')
2167-
])
2164+
'--workspace-name {workspace} --spark-pool-name {spark-pool} --yes')
21682165

21692166
# delete/cancel a spark session
21702167
self.cmd('az synapse spark session cancel --livy-id {session-id} --workspace-name {workspace} '

src/azure-cli/requirements.py3.Darwin.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ azure-multiapi-storage==1.3.0
8484
azure-nspkg==3.0.2
8585
azure-storage-common==1.4.2
8686
azure-synapse-accesscontrol==0.5.0
87-
azure-synapse-artifacts==0.19.0
87+
azure-synapse-artifacts==0.20.0
8888
azure-synapse-managedprivateendpoints==0.4.0
89-
azure-synapse-spark==0.2.0
89+
azure-synapse-spark==0.7.0
9090
bcrypt==3.2.0
9191
certifi==2024.7.4
9292
cffi==1.16.0

src/azure-cli/requirements.py3.Linux.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ azure-multiapi-storage==1.3.0
8484
azure-nspkg==3.0.2
8585
azure-storage-common==1.4.2
8686
azure-synapse-accesscontrol==0.5.0
87-
azure-synapse-artifacts==0.19.0
87+
azure-synapse-artifacts==0.20.0
8888
azure-synapse-managedprivateendpoints==0.4.0
89-
azure-synapse-spark==0.2.0
89+
azure-synapse-spark==0.7.0
9090
bcrypt==3.2.0
9191
certifi==2024.7.4
9292
cffi==1.16.0

src/azure-cli/requirements.py3.windows.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ azure-multiapi-storage==1.3.0
8484
azure-nspkg==3.0.2
8585
azure-storage-common==1.4.2
8686
azure-synapse-accesscontrol==0.5.0
87-
azure-synapse-artifacts==0.19.0
87+
azure-synapse-artifacts==0.20.0
8888
azure-synapse-managedprivateendpoints==0.4.0
89-
azure-synapse-spark==0.2.0
89+
azure-synapse-spark==0.7.0
9090
bcrypt==3.2.0
9191
certifi==2024.7.4
9292
cffi==1.16.0

src/azure-cli/setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@
126126
'azure-multiapi-storage~=1.3.0',
127127
'azure-storage-common~=1.4',
128128
'azure-synapse-accesscontrol~=0.5.0',
129-
'azure-synapse-artifacts~=0.19.0',
129+
'azure-synapse-artifacts~=0.20.0',
130130
'azure-synapse-managedprivateendpoints~=0.4.0',
131-
'azure-synapse-spark~=0.2.0',
131+
'azure-synapse-spark~=0.7.0',
132132
'chardet~=5.2.0',
133133
'colorama~=0.4.4',
134134
# On Linux, the distribution (Ubuntu, Debian, etc) and version are checked for `az feedback`

0 commit comments

Comments
 (0)