Summary
FabricConnectionManager.get_response returns message = "OK" regardless of what cursor.messages contained. Two things go missing on every query:
- SQL warnings, notices, and non-fatal errors — Fabric surfaces
RAISERROR with severity < 11, PRINT output, deprecation notices, and informational warnings through cursor messages.
- The distributed statement ID — every Fabric DW query gets a server-side GUID emitted in
cursor.messages as statement id: {...}, used by the Fabric portal, query history, and the Capacity Metrics app to identify queries.
Evidence (HEAD 0de2190, v1.10.0)
dbt/adapters/fabric/fabric_connection_manager.py#L746-L748:
def get_response(cls, cursor: Any) -> AdapterResponse:
# message = str(cursor.statusmessage)
message = "OK"
The first line is commented out; the second hardcodes "OK". cursor.messages is never read.
User impact
- Users see no SQL warnings or
PRINT output during dbt runs. Issues that Fabric surfaces as warnings (deprecations, optimizer hints, partial-result notices) reach the user only when they escalate into hard errors elsewhere.
- The distributed statement ID is never propagated to dbt's
AdapterResponse.query_id. Anyone trying to correlate a slow query in the Fabric portal back to the dbt model that issued it has no link.
Suggested fix
Parse cursor.messages:
def get_response(cls, cursor) -> AdapterResponse:
messages = getattr(cursor, "messages", None) or []
text_parts: list[str] = []
statement_id: str | None = None
for entry in messages:
text = entry[1] if isinstance(entry, (list, tuple)) and len(entry) > 1 else str(entry)
text_parts.append(text)
m = re.search(r"statement id:\s*([0-9A-Fa-f-]{36})", text)
if m:
statement_id = m.group(1)
rows_affected = getattr(cursor, "rowcount", -1)
return AdapterResponse(
_message="\n".join(text_parts) if text_parts else "OK",
rows_affected=rows_affected,
query_id=statement_id,
)
A PR with the full change is linked from this issue.
Summary
FabricConnectionManager.get_responsereturnsmessage = "OK"regardless of whatcursor.messagescontained. Two things go missing on every query:RAISERRORwith severity < 11,PRINToutput, deprecation notices, and informational warnings through cursor messages.cursor.messagesasstatement id: {...}, used by the Fabric portal, query history, and the Capacity Metrics app to identify queries.Evidence (HEAD
0de2190, v1.10.0)dbt/adapters/fabric/fabric_connection_manager.py#L746-L748:The first line is commented out; the second hardcodes
"OK".cursor.messagesis never read.User impact
PRINToutput during dbt runs. Issues that Fabric surfaces as warnings (deprecations, optimizer hints, partial-result notices) reach the user only when they escalate into hard errors elsewhere.AdapterResponse.query_id. Anyone trying to correlate a slow query in the Fabric portal back to the dbt model that issued it has no link.Suggested fix
Parse
cursor.messages:A PR with the full change is linked from this issue.