Skip to content

Commit dbea5ce

Browse files
committed
Fetch flag value of force_refresh for assessment rerun
1 parent 88d8e3b commit dbea5ce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/databricks/labs/ucx/cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,16 @@ def validate_external_locations(
219219

220220

221221
@ucx.command
222-
def ensure_assessment_run(w: WorkspaceClient, run_as_collection: bool = False, a: AccountClient | None = None):
222+
def ensure_assessment_run(w: WorkspaceClient, run_as_collection: bool = False, a: AccountClient | None = None, **named_parameters):
223223
"""ensure the assessment job was run on a workspace"""
224224
workspace_contexts = _get_workspace_contexts(w, a, run_as_collection)
225+
force_refresh = named_parameters.get("force_refresh", "false").lower() == "true"
225226
for ctx in workspace_contexts:
226227
workspace_id = ctx.workspace_client.get_workspace_id()
227228
logger.info(f"Checking assessment workflow in workspace: {workspace_id}")
228229
deployed_workflows = ctx.deployed_workflows
229230
# Note: will block if the workflow is already underway but not completed.
230-
if deployed_workflows.validate_step("assessment"):
231+
if deployed_workflows.validate_step("assessment") and not force_refresh:
231232
logger.info(f"The assessment workflow has successfully completed in workspace: {workspace_id}")
232233
else:
233234
logger.info(f"Starting assessment workflow in workspace: {workspace_id}")

0 commit comments

Comments
 (0)