From cfa741e59799f48e81f82b48fac7a8c5772c5940 Mon Sep 17 00:00:00 2001 From: Nick Vogt Date: Fri, 14 Aug 2020 10:22:00 -0400 Subject: [PATCH 1/4] calculate Redshift table size in bytes, not megabytes --- CHANGELOG.md | 4 ++++ plugins/redshift/dbt/include/redshift/macros/catalog.sql | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71a587aeb02..87e0cd58242 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,9 +15,13 @@ - Added a `dispatch` method to the context adapter and deprecated `adapter_macro`. ([#2302](https://github.com/fishtown-analytics/dbt/issues/2302), [#2679](https://github.com/fishtown-analytics/dbt/pull/2679)) - The built-in schema tests now use `adapter.dispatch`, so they can be overridden for adapter plugins ([#2415](https://github.com/fishtown-analytics/dbt/issues/2415), [#2684](https://github.com/fishtown-analytics/dbt/pull/2684)) +### Fixes +- Fix Redshift table size estimation; e.g. 44 GB tables are no longer reported as 44 KB. [#2702](https://github.com/fishtown-analytics/dbt/issues/2702) + Contributors: - [@bbhoss](https://github.com/bbhoss) ([#2677](https://github.com/fishtown-analytics/dbt/pull/2677)) - [@kconvey](https://github.com/kconvey) ([#2694](https://github.com/fishtown-analytics/dbt/pull/2694)) +- [@vogt4nick](https://github.com/vogt4nick) ([#2702](https://github.com/fishtown-analytics/dbt/issues/2702)) ## dbt 0.18.0b2 (July 30, 2020) diff --git a/plugins/redshift/dbt/include/redshift/macros/catalog.sql b/plugins/redshift/dbt/include/redshift/macros/catalog.sql index a5070788d34..b34460035e2 100644 --- a/plugins/redshift/dbt/include/redshift/macros/catalog.sql +++ b/plugins/redshift/dbt/include/redshift/macros/catalog.sql @@ -147,7 +147,7 @@ (sortkey_num > 0) as "stats:sortkey_num:include", 'Approximate Size' as "stats:size:label", - size / 1000000.0 as "stats:size:value", + size * 1000000 as "stats:size:value", 'Approximate size of the table, calculated from a count of 1MB blocks'::text as "stats:size:description", true as "stats:size:include", From 274aea9f8f13abc32f3283909ab570081c9b9bbb Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Mon, 17 Aug 2020 11:36:09 -0400 Subject: [PATCH 2/4] Track deprecation warnings --- CHANGELOG.md | 1 + core/dbt/deprecations.py | 6 ++++++ core/dbt/tracking.py | 20 ++++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 192ed191c71..10a8c5d778b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ### Under the hood - Upgraded snowflake-connector-python dependency to 2.2.10 and enabled the SSO token cache ([#2613](https://github.com/fishtown-analytics/dbt/issues/2613), [#2689](https://github.com/fishtown-analytics/dbt/issues/2689), [#2698](https://github.com/fishtown-analytics/dbt/pull/2698)) +- Add deprecation warnings to anonymous usage tracking ([#2688](https://github.com/fishtown-analytics/dbt/issues/2688), [#2710](https://github.com/fishtown-analytics/dbt/issues/2710)) ### Features - Add better retry support when using the BigQuery adapter ([#2694](https://github.com/fishtown-analytics/dbt/pull/2694), follow-up to [#1963](https://github.com/fishtown-analytics/dbt/pull/1963)) diff --git a/core/dbt/deprecations.py b/core/dbt/deprecations.py index 7fae52431c2..1781ee0e9b0 100644 --- a/core/dbt/deprecations.py +++ b/core/dbt/deprecations.py @@ -16,6 +16,11 @@ def name(self) -> str: 'name not implemented for {}'.format(self) ) + def track_deprecation_warn(self) -> None: + dbt.tracking.track_deprecation_warn({ + "deprecation_name": self.name + }) + @property def description(self) -> str: if self._description is not None: @@ -31,6 +36,7 @@ def show(self, *args, **kwargs) -> None: desc, prefix='* Deprecation Warning: ' ) dbt.exceptions.warn_or_error(msg) + self.track_deprecation_warn() active_deprecations.add(self.name) diff --git a/core/dbt/tracking.py b/core/dbt/tracking.py index 133a6c13838..d9ea3ec0a91 100644 --- a/core/dbt/tracking.py +++ b/core/dbt/tracking.py @@ -26,6 +26,7 @@ INVOCATION_ENV_SPEC = 'iglu:com.dbt/invocation_env/jsonschema/1-0-0' PACKAGE_INSTALL_SPEC = 'iglu:com.dbt/package_install/jsonschema/1-0-0' RPC_REQUEST_SPEC = 'iglu:com.dbt/rpc_request/jsonschema/1-0-1' +DEPRECATION_WARN_SPEC = 'iglu:com.dbt/deprecation_warn/jsonschema/1-0-0' DBT_INVOCATION_ENV = 'DBT_INVOCATION_ENV' @@ -321,6 +322,25 @@ def track_package_install(config, args, options): ) +def track_deprecation_warn(options): + + assert active_user is not None, \ + 'Cannot track deprecation warnings when active user is None' + + context = [ + SelfDescribingJson(DEPRECATION_WARN_SPEC, options) + ] + + track( + active_user, + category="dbt", + action='deprecation', + label=active_user.invocation_id, + property_='warn', + context=context + ) + + def track_invocation_end( config=None, args=None, result_type=None ): From a573a2ada1303b238444552004bd4c5a41b439c6 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Mon, 17 Aug 2020 17:00:07 -0400 Subject: [PATCH 3/4] Explicitly import dbt.tracking module --- core/dbt/deprecations.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/dbt/deprecations.py b/core/dbt/deprecations.py index 1781ee0e9b0..da8f1f79c25 100644 --- a/core/dbt/deprecations.py +++ b/core/dbt/deprecations.py @@ -3,6 +3,8 @@ import dbt.exceptions from dbt import ui +import dbt.tracking + class DBTDeprecation: _name: ClassVar[Optional[str]] = None From 1ba832dbfe4984cac8e2ab67c94a670c04e2e15c Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Tue, 18 Aug 2020 18:37:32 -0400 Subject: [PATCH 4/4] Docs site updates for 0.18.0 --- CHANGELOG.md | 7 +++++++ core/dbt/include/index.html | 32 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10a8c5d778b..24932fb6a32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,10 +20,17 @@ ### Fixes - Fix Redshift table size estimation; e.g. 44 GB tables are no longer reported as 44 KB. [#2702](https://github.com/fishtown-analytics/dbt/issues/2702) +### Docs +- Add "Referenced By" and "Depends On" sections for each node ([docs#106](https://github.com/fishtown-analytics/dbt-docs/pull/106)) +- Add Name, Description, Column, SQL, Tags filters to site search ([docs#108](https://github.com/fishtown-analytics/dbt-docs/pull/108)) +- Add relevance criteria to site search ([docs#113](https://github.com/fishtown-analytics/dbt-docs/pull/113)) +- Support new selector methods, intersection, and arbitrary parent/child depth in DAG selection syntax ([docs#118](https://github.com/fishtown-analytics/dbt-docs/pull/118)) + Contributors: - [@bbhoss](https://github.com/bbhoss) ([#2677](https://github.com/fishtown-analytics/dbt/pull/2677)) - [@kconvey](https://github.com/kconvey) ([#2694](https://github.com/fishtown-analytics/dbt/pull/2694)) - [@vogt4nick](https://github.com/vogt4nick) ([#2702](https://github.com/fishtown-analytics/dbt/issues/2702)) +- [@stephen8chang](https://github.com/stephen8chang) ([docs#106](https://github.com/fishtown-analytics/dbt-docs/pull/106), [docs#108](https://github.com/fishtown-analytics/dbt-docs/pull/108), [docs#113](https://github.com/fishtown-analytics/dbt-docs/pull/113)) ## dbt 0.18.0b2 (July 30, 2020) diff --git a/core/dbt/include/index.html b/core/dbt/include/index.html index 9dbe6bdbf4c..cac398baaf4 100644 --- a/core/dbt/include/index.html +++ b/core/dbt/include/index.html @@ -8,7 +8,7 @@ - + @@ -24,7 +24,7 @@
icons
-