dbt-labs / dbt-labs/dbt-adapters
[Feature] Include session_id in `dbt-snowflake` adapter response
- Dominant language
- Python
- Stars
- 233
- Forks
- 362
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 9
Description
### Is this your first time submitting a feature request?
- [x] I have read the [expectations for open source contributors](https://docs.getdbt.com/docs/contributing/oss-expectations)
- [x] I have searched the existing issues, and I could not find an existing issue for this feature
- [x] 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`.
```python
@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_
Contributor guide
Assessment
This issue has not been assessed yet.