From a7b2536f0a7c56d94646ef22d372335ea4c383bc Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Fri, 3 Sep 2021 15:35:58 +0200 Subject: [PATCH 1/2] Add adapter unique_field --- dbt/adapters/spark/connections.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dbt/adapters/spark/connections.py b/dbt/adapters/spark/connections.py index 7bf6d159a..f8b4583e8 100644 --- a/dbt/adapters/spark/connections.py +++ b/dbt/adapters/spark/connections.py @@ -134,6 +134,10 @@ def __post_init__(self): @property def type(self): return 'spark' + + @property + def unique_field(self): + return self.host def _connection_keys(self): return ('host', 'port', 'cluster', From fe5d096511116ddbcf4ead75a515296b6e0b2365 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Fri, 3 Sep 2021 15:39:32 +0200 Subject: [PATCH 2/2] Fix flake8. Add changelog entry --- CHANGELOG.md | 3 +++ dbt/adapters/spark/connections.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6f8c272f..7405e9e0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ - Enhanced get_columns_in_relation method to handle a bug in open source deltalake which doesnt return schema details in `show table extended in databasename like '*'` query output. This impacts dbt snapshots if file format is open source deltalake ([#207](https://github.com/dbt-labs/dbt-spark/pull/207)) - Parse properly columns when there are struct fields to avoid considering inner fields: Issue ([#202](https://github.com/dbt-labs/dbt-spark/issues/202)) +### Under the hood +- Add `unique_field` to better understand adapter adoption in anonymous usage tracking ([#211](https://github.com/dbt-labs/dbt-spark/pull/211)) + ### Contributors - [@harryharanb](https://github.com/harryharanb) ([#207](https://github.com/dbt-labs/dbt-spark/pull/207)) - [@SCouto](https://github.com/Scouto) ([#204](https://github.com/dbt-labs/dbt-spark/pull/204)) diff --git a/dbt/adapters/spark/connections.py b/dbt/adapters/spark/connections.py index f8b4583e8..41413f355 100644 --- a/dbt/adapters/spark/connections.py +++ b/dbt/adapters/spark/connections.py @@ -134,7 +134,7 @@ def __post_init__(self): @property def type(self): return 'spark' - + @property def unique_field(self): return self.host