Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Apr 25, 2024
1 parent 2995625 commit 7487959
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/databricks/labs/ucx/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,6 @@ def migrate_tables(w: WorkspaceClient, prompts: Prompts, *, ctx: WorkspaceContex
Trigger the migrate-tables workflow and, optionally, the migrate-external-hiveserde-tables-in-place-experimental
workflow.
"""
migrate_hiveserde_tables_workflow_name = "migrate-external-hiveserde-tables-in-place-experimental"

if ctx is None:
ctx = WorkspaceContext(w)
deployed_workflows = ctx.deployed_workflows
Expand All @@ -418,9 +416,9 @@ def migrate_tables(w: WorkspaceClient, prompts: Prompts, *, ctx: WorkspaceContex
percentage_hiveserde_tables = len(hiveserde_tables) / len(tables) * 100
if prompts.confirm(
f"Found {len(hiveserde_tables)} ({percentage_hiveserde_tables:.2f}%) hiveserde tables, do you want to run "
f"the {migrate_hiveserde_tables_workflow_name} workflow?"
f"the migrate-external-hiveserde-tables-in-place-experimental workflow?"
):
deployed_workflows.run_workflow(migrate_hiveserde_tables_workflow_name)
deployed_workflows.run_workflow("migrate-external-hiveserde-tables-in-place-experimental")


if __name__ == "__main__":
Expand Down
6 changes: 1 addition & 5 deletions tests/unit/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,7 @@ def test_migrate_tables(ws):
def test_migrate_external_hiveserde_tables_in_place(ws):
tables_crawler = create_autospec(TablesCrawler)
table = Table(
catalog="hive_metastore",
database="test",
name="hiveserde",
object_type="UNKNOWN",
table_format="HIVE"
catalog="hive_metastore", database="test", name="hiveserde", object_type="UNKNOWN", table_format="HIVE"
)
tables_crawler.snapshot.return_value = [table]
ctx = WorkspaceContext(ws).replace(tables_crawler=tables_crawler)
Expand Down

0 comments on commit 7487959

Please sign in to comment.