Repository navigation
feat: column-level impact answer in impact_analysis, with one column resolver for dbt_lineage
#1710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d973fc6
3a4e192
76a5f81
823626c
fefa0ea
6725250
2a6aa7a
bb41fc9
9d7e7a3
1211d0d
ae98c58
2720d51
539df47
d1b4af4
9de12b6
917f0c1
86f5045
01e4a95
f271635
47b6241
64fe492
f7d758c
270df7d
e580a51
0189b55
a01f898
77f7a0d
afe7320
ef9d86f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,8 +61,11 @@ const STRUCTURED_FIELDS: Record<string, readonly string[]> = { | |
| "test_count", | ||
| "downstream", | ||
| "exposures", | ||
| "exposures_declared", | ||
| "column_reach", | ||
| "column_reach_error", | ||
| "column_answer", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep the column answer available when the MCP size cap is reached. A valid answer with roughly 1,000 column records can exceed 60,000 serialized bytes while remaining below
|
||
| "column_answer_error", | ||
| "exposures_error", | ||
| "error", | ||
| ], | ||
|
|
@@ -96,7 +99,15 @@ export function structuredResult(tool: string, metadata: Record<string, unknown> | |
| // dbt_lineage's text prints the same mappings and edges as `columns` and `edges`: keep its header. | ||
| const head = tool === "dbt_lineage" && "columns" in fields ? report.split(/\n(?:Column Mappings|Lineage Edges):/)[0]!.trim() : report | ||
| const full = { ...fields, report: head } | ||
| return Buffer.byteLength(JSON.stringify(full)) <= STRUCTURED_MAX_BYTES ? full : capReport(report, true) | ||
| if (Buffer.byteLength(JSON.stringify(full)) <= STRUCTURED_MAX_BYTES) return full | ||
| // The column answer is the largest field: past the cap it goes first, so the model-level fields | ||
| // and the reach stay. | ||
| if ("column_answer" in full) { | ||
| const { column_answer: _, ...rest } = full | ||
| const lighter = { ...rest, column_answer_error: "Left out of the structured result for size; the CLI's --json output carries it." } | ||
| if (Buffer.byteLength(JSON.stringify(lighter)) <= STRUCTURED_MAX_BYTES) return lighter | ||
| } | ||
| return capReport(report, true) | ||
| } | ||
| /** An error report held to the same cap as a result, so a huge exception message cannot exceed it. */ | ||
| export function structuredError(message: string): Record<string, unknown> { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.