fix: add missing async/await to graph children/parents commands#176
Open
dev-punia-altimate wants to merge 1 commit intofeat/builder-prompt-and-dbt-skillsfrom
Open
fix: add missing async/await to graph children/parents commands#176dev-punia-altimate wants to merge 1 commit intofeat/builder-prompt-and-dbt-skillsfrom
dev-punia-altimate wants to merge 1 commit intofeat/builder-prompt-and-dbt-skillsfrom
Conversation
…utopilot)
Both children() and parents() in graph.ts call async adapter methods
(getChildrenModels, getParentModels) without await, returning unresolved
Promises. The callers in index.ts also miss the outer await, unlike all
other switch cases.
Effects:
- JSON.stringify(Promise) produces {} — empty output
- adapter.dispose() fires before the Promise settles, crashing the bridge
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
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.
Evidence Matrix
await, only children/parents miss itDiscovery
How I found this: Behavioral analysis of PR #174 (
feat/builder-prompt-and-dbt-skills).Both
children()andparents()ingraph.tsare the only commands missingasync/await.Root Cause Analysis
Both
childrenandparentsinpackages/dbt-tools/src/commands/graph.tsare declared as plain synchronous functions but call async adapter methods (getChildrenModels,getParentModels) withoutawait:In
index.ts, the call sites also lack the outerawait:Effects:
resultis a Promise object →JSON.stringify(Promise)produces{}→ empty outputfinally { await adapter.dispose() }block fires immediately, disposing the Python bridge while the Promise is still pending → crash on the unhandled rejectionAll other switch cases (compile, test, build-project, execute, columns, deps, etc.) correctly use
result = await (await import(...)).fn(...).Why This Fix Resolves It
asynckeyword to both function declarations andawaitbefore adapter callsawaitbefore both.children()and.parents()callsThis matches the exact pattern used by every other command in the switch block. The adapter methods are confirmed async (same interface as
getColumnsOfModelwhich is awaited incolumns.ts).Self-Critique
await, these two don't.awaitfix.--modelflag still works (returns sync{ error }before hitting adapter).Impact
childrenandparentsdbt graph commands — always produce empty output{}instead of model dependency dataawaitis backward-compatible; matches all other command patternsGenerated by QA Autopilot | PR #174