Skip to content

Fix missing model name in console error output for driver failures) - #6066

Open
sakshipatil-hue wants to merge 3 commits into
SQLMesh:mainfrom
sakshipatil-hue:patch-2
Open

sakshipatil-hue wants to merge 3 commits into
SQLMesh:mainfrom
sakshipatil-hue:patch-2

Conversation

@sakshipatil-hue

@sakshipatil-hue sakshipatil-hue commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes an issue where low-level driver or engine errors (such as casting exceptions) fail to display the failing model or snapshot name in the console error output.

Updated _format_node_error in sqlmesh/core/console.py to add robust fallback checks. If error.node lacks standard snapshot_name or SnapshotId attributes, it now checks for a .name attribute or safely falls back to stringifying the node (str(error.node)), ensuring the failing model name is always surfaced in logs.

Test Plan

Manually verified that when a node execution fails due to low-level engine or driver errors where error.node lacks standard snapshot attributes, the console correctly falls back to .name or str(error.node) and successfully outputs the failing model name instead of leaving it blank.

Checklist

  • I have run make style and fixed any issues
  • I have added tests for my changes (if applicable)
  • All existing tests pass (make fast-test)
  • My commits are signed off (git commit -s) per the DCO

@cmgoffena13
cmgoffena13 removed their request for review September 18, 2026 04:11
@cmgoffena13

Copy link
Copy Markdown
Collaborator

Hey @sakshipatil-hue

Before we go further on the patch, could you open a GitHub issue with more detail on the failure you hit? The current change adds fallbacks in _format_node_errors, but that path already extracts a name for SnapshotId and for scheduler nodes with snapshot_name. A driver/engine exception as the cause would not by itself blank out the model name there, so I want to make sure we are fixing the same bug you saw.

In the issue, please include:

  • The command (sqlmesh plan / apply / run, CICD bot, etc.)
  • Engine / adapter
  • The exact console (or PR comment) output, including the Failed models section if you got one
  • What you expected to see instead
  • A small repro if you have one (model SQL + the error)

Also, as a reminder: when submitting a PR please make sure your commits are DCO signed

@cmgoffena13

cmgoffena13 commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

@sakshipatil-hue -- is this the issue you're trying to resolve: #6064 ? -- adding a comment on the issue with your own details might be helpful!

@sakshipatil-hue

Copy link
Copy Markdown
Contributor Author

@cmgoffena13-- Yes, #6064 is indeed the issue I am addressing!

To provide the context requested:

  • Command: sqlmesh plan / sqlmesh apply
  • Details: When a driver-level or engine evaluation exception occurs, error.node doesn't always cleanly expose the model/snapshot name, leading to blank or missing identification in the console output. This change ensures it properly falls back to extract the name so it surfaces correctly.

I will also ensure my commits are DCO signed off shortly. Thanks for reviewing!

Signed-off-by: Sakshi Patil <sakshipatil@users.noreply.github.com>
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.

2 participants