Skip to content

Commit 460d388

Browse files
authored
[SC-71155] Fix TypeError in Pipelines CLI (#361)
We were indexing by key into a string instead of a dict.
1 parent d531726 commit 460d388

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

databricks_cli/pipelines/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ def deploy_cli(api_client, spec_arg, spec, allow_duplicate_names, pipeline_id):
106106
if (pipeline_id and 'id' in spec_obj) and pipeline_id != spec_obj["id"]:
107107
raise ValueError(
108108
"The ID provided in --pipeline_id '{}' is different from the id provided "
109-
"the spec '{}'. Please resolve the conflict and try the command again. "
109+
"in the spec '{}'. Please resolve the conflict and try the command again. "
110110
"Because pipeline IDs are no longer persisted after being deleted, we "
111111
"recommend removing the ID field from your spec."
112-
.format(pipeline_id, spec["id"])
112+
.format(pipeline_id, spec_obj["id"])
113113
)
114114

115115
spec_obj['id'] = pipeline_id or spec_obj.get('id', None)

tests/pipelines/test_cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,4 +307,6 @@ def test_deploy_pipeline_conflicting_ids(pipelines_api_mock, tmpdir):
307307

308308
result = CliRunner().invoke(cli.deploy_cli, ['--spec', path, '--pipeline-id', "fake"])
309309
assert result.exit_code == 1
310+
assert "ValueError: The ID provided in --pipeline_id 'fake' is different from the id " \
311+
"provided in the spec '123'." in result.stdout
310312
assert pipelines_api_mock.deploy.call_count == 0

0 commit comments

Comments
 (0)