Skip to content

Add offending view name to error logs in view_migrate#4867

Open
rohany395 wants to merge 1 commit into
databrickslabs:mainfrom
rohany395:fix/4438-view-error-loggin
Open

Add offending view name to error logs in view_migrate#4867
rohany395 wants to merge 1 commit into
databrickslabs:mainfrom
rohany395:fix/4438-view-error-loggin

Conversation

@rohany395

Copy link
Copy Markdown

Resolves #4438

Problem

When migrate-tables fails to analyze a view's SQL in view_migrate.py,
the error and log messages include the view's DDL but not the view's name.
With many views processed in parallel, this makes it hard to identify which
view caused the failure.

Change

Adds the offending view's key (self.src.key) to the three failure sites in
ViewToMigrate._view_dependencies:

  • The ValueError raised on a sqlglot ParseError
  • The ValueError raised when parsing yields no usable statement
  • The logger.error emitted when a referenced table's schema can't be determined

Tests

Extended test_sequence_view_with_invalid_query_raises_value_error to assert
the offending view's key appears in the raised error message.

Note on scope

This PR is scoped to the logging improvement requested
("at a minimum add logging"), which also provides the diagnostics needed
to confirm the offending view and DDL when investigating that underlying
parsing behavior.

@rohany395 rohany395 requested a review from a team as a code owner June 9, 2026 04:01
@CLAassistant

CLAassistant commented Jun 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@rohany395 rohany395 force-pushed the fix/4438-view-error-loggin branch from de1a96b to fd50542 Compare June 9, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Tables Error Handling - Request for offending table or view name in logs

2 participants