Add offending view name to error logs in view_migrate#4867
Open
rohany395 wants to merge 1 commit into
Open
Conversation
de1a96b to
fd50542
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #4438
Problem
When
migrate-tablesfails to analyze a view's SQL inview_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 inViewToMigrate._view_dependencies:ValueErrorraised on a sqlglotParseErrorValueErrorraised when parsing yields no usable statementlogger.erroremitted when a referenced table's schema can't be determinedTests
Extended
test_sequence_view_with_invalid_query_raises_value_errorto assertthe 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.