Skip to content

[Feature] Include session_id in dbt-snowflake adapter response #1751

@macks22

Description

@macks22

Is this your first time submitting a feature request?

  • I have read the expectations for open source contributors
  • I have searched the existing issues, and I could not find an existing issue for this feature
  • I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion

Describe the feature

As a dbt user, I want to be able to quickly look up information about the set of queries associated with a dbt model run rather than just the final create/insert/update statement. While the query_id is useful, the session_id can provided richer information back to Snowflake users to under the full lifecycle of queries executed.

To implement this feature, we could extend the SnowflakeAdapterResponse to include the session_id.

@dataclass
class SnowflakeAdapterResponse(AdapterResponse):
    query_id: str = ""
    session_id: str = ""

Describe alternatives you've considered

A pre_hook or post_hook that executes run_query("select current_session()") can work, but it introduces an additional DB interaction that's not necessary. It also limits applicability, since this can't be called in on-run-end (as the session will differ).

Who will this benefit?

This would help dbt-snowflake users to more effectively debug and understand why their queries succeeded or failed.

Are you interested in contributing this feature?

Yes!

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions