Skip to content

Commit

Permalink
Return False when failed to migrate table (#2982)
Browse files Browse the repository at this point in the history
Return `False` when failed to migrate.
  • Loading branch information
JCZuurmond authored Oct 17, 2024
1 parent 5423f58 commit 6ff3621
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/databricks/labs/ucx/hive_metastore/table_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def _migrate_managed_table(self, managed_table_external_storage: str, src_table:
if managed_table_external_storage == 'CLONE':
return self._migrate_table_create_ctas(src_table.src, src_table.rule)
logger.warning(f"failed-to-migrate: unknown managed_table_external_storage: {managed_table_external_storage}")
return True
return False

def _safe_migrate_table(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def is_migrated(self, schema: str, table: str) -> bool:
return True
logger.info(f"{schema}.{table} is set as not migrated")
except NotFound:
# If the source table doesn't exist, it will not be shown as migrated
# If the source table doesn't exist anymore, we mark it as migrated to avoid trying to migrate it again and
# for views that have the table as dependency
logger.warning(f"failed-to-migrate: {schema}.{table} set as a source does no longer exist")
return True
return False
Expand Down

0 comments on commit 6ff3621

Please sign in to comment.