Skip to content

Surface cursor messages and statement id from get_response#390

Open
sdebruyn wants to merge 1 commit into
microsoft:mainfrom
sdebruyn:get-response
Open

Surface cursor messages and statement id from get_response#390
sdebruyn wants to merge 1 commit into
microsoft:mainfrom
sdebruyn:get-response

Conversation

@sdebruyn
Copy link
Copy Markdown
Collaborator

Fixes #389.

FabricConnectionManager.get_response discarded everything cursor.messages contained and returned a hardcoded "OK". SQL warnings, PRINT output, deprecation notices, and the Fabric distributed statement ID never reached AdapterResponse, so dbt users had no visibility into cursor-side diagnostics and no way to correlate a dbt model with its server-side query in the Fabric portal or Capacity Metrics app.

Changes

  • Read cursor.messages and join the message texts into AdapterResponse._message. Falls back to "OK" only when the cursor produced no messages.
  • Extract the distributed statement ID (the GUID that Fabric emits as Statement ID: ... in cursor.messages) and pass it through as AdapterResponse.query_id.
  • The accidentally-commented statusmessage block is removed.

Testing

Marking as draft so the maintainers can wire this through the project's test suite. Happy to extend the change with unit tests covering the message parsing and the GUID-extraction regex if that's the preferred follow-up.

Replace the hardcoded 'OK' status string with the joined contents of
cursor.messages, and extract the Fabric distributed statement id from
the cursor output into AdapterResponse.query_id. This makes SQL warnings,
PRINT output and informational notices visible during dbt runs and lets
downstream tooling correlate a dbt model with its server-side query in
the Fabric portal and Capacity Metrics app.
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.

get_response returns hardcoded "OK" and discards every cursor message (warnings + distributed statement ID)

1 participant