fix(dlt): surface underlying error and hint when attaching to pipeline fails#5836
Open
nkwork9999 wants to merge 1 commit into
Open
fix(dlt): surface underlying error and hint when attaching to pipeline fails#5836nkwork9999 wants to merge 1 commit into
nkwork9999 wants to merge 1 commit into
Conversation
…e fails When `sqlmesh init -t dlt --dlt-path <path>` could not attach to the pipeline, the underlying dlt error was swallowed and replaced with an uninformative message. `--dlt-path` points to dlt's pipelines working directory (by default ~/.dlt/pipelines), not the directory containing the pipeline scripts, which is a common source of confusion. Now the error includes the original dlt exception, the directory that was searched, and a hint to omit `--dlt-path` when the pipeline exists in the default working directory. Also clarifies the `--dlt-path` help text and docstring accordingly. Fixes SQLMesh#5660. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Description
Fixes #5660.
When
sqlmesh init -t dlt --dlt-path <path>cannot attach to the pipeline, the underlying dlt error is swallowed and replaced with an uninformativeCould not attach to pipeline <name>message.The root cause of the confusion in #5660 is that
--dlt-pathmust point to dlt's pipelines working directory (where pipeline state is stored, by default~/.dlt/pipelines), not the directory containing the pipeline scripts — and both the help text and the swallowed error gave the user no way to discover that.This PR:
--dlt-pathwhen a pipeline with the given name exists in the default pipelines working directory (the exact scenario in [bug] DLT Error: Could not attach to pipeline #5660).--dlt-pathhelp text, docstring, and CLI docs.Before:
After:
Test Plan
uv run --extra dev --extra web --extra slack --extra dlt --extra lsp make styleuv run --extra dev --extra web --extra slack --extra dlt --extra lsp pytest tests/cli/test_cli.py -q(the one failure,test_plan_very_verbose, also fails onmainin my environment and is unrelated)test_dlt_pipelinetest to assert that the error reports the searched directory and the--dlt-pathhint.Checklist
make styleand fixed any issues