Skip to content

Commit

Permalink
Merge branch 'dev/marian-anderson' into enhancement/color_output_comm…
Browse files Browse the repository at this point in the history
…and_line_flag_second_attempt
  • Loading branch information
rsenseman authored Aug 19, 2020
2 parents b075bf5 + 674bd8f commit db8eea2
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 17 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -17,11 +18,23 @@
- Add state:modified and state:new selectors ([#2641](https://github.com/fishtown-analytics/dbt/issues/2641), [#2695](https://github.com/fishtown-analytics/dbt/pull/2695))
- Add two new flags `--use-colors` and `--no-use-colors` to `dbt run` command to enable or disable log colorization from the command line ([#2708](https://github.com/fishtown-analytics/dbt/pull/2708))

### 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))
- [@rsenseman](https://github.com/rsenseman) ([#2708](https://github.com/fishtown-analytics/dbt/pull/2708))


## dbt 0.18.0b2 (July 30, 2020)

### Features
Expand Down
8 changes: 8 additions & 0 deletions core/dbt/deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import dbt.exceptions
from dbt import ui

import dbt.tracking


class DBTDeprecation:
_name: ClassVar[Optional[str]] = None
Expand All @@ -16,6 +18,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:
Expand All @@ -31,6 +38,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)


Expand Down
32 changes: 16 additions & 16 deletions core/dbt/include/index.html

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions core/dbt/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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
):
Expand Down
2 changes: 1 addition & 1 deletion plugins/redshift/dbt/include/redshift/macros/catalog.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand Down

0 comments on commit db8eea2

Please sign in to comment.