Skip to content

Commit

Permalink
Merge pull request #2892 from rsella/dev/kiyoshi-kuromiya
Browse files Browse the repository at this point in the history
Change dbt list command to always return 0 as exit code
  • Loading branch information
jtcohen6 authored Nov 17, 2020
2 parents 72e808c + 009b75c commit ec0f3d2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Fix Redshift adapter `get_columns_in_relation` macro to push schema filter down to the `svv_external_columns` view ([#2855](https://github.com/fishtown-analytics/dbt/issues/2854))
- Add `unixodbc-dev` package to testing docker image ([#2859](https://github.com/fishtown-analytics/dbt/pull/2859))
- Increased the supported relation name length in postgres from 29 to 51 ([#2850](https://github.com/fishtown-analytics/dbt/pull/2850))
- dbt list command always return 0 as exit code ([#2886](https://github.com/fishtown-analytics/dbt/issues/2886), [#2892](https://github.com/fishtown-analytics/dbt/issues/2892))

### Under the hood
- Bump hologram version to 0.0.11. Add scripts/dtr.py ([#2888](https://github.com/fishtown-analytics/dbt/issues/2840),[#2889](https://github.com/fishtown-analytics/dbt/pull/2889))
Expand All @@ -22,6 +23,7 @@ Contributors:
- [@brangisom](https://github.com/brangisom) [#2855](https://github.com/fishtown-analytics/dbt/pull/2855)
- [@elexisvenator](https://github.com/elexisvenator) ([#2850](https://github.com/fishtown-analytics/dbt/pull/2850))
- [@franloza](https://github.com/franloza) ([#2837](https://github.com/fishtown-analytics/dbt/pull/2837))
- [@rsella](https://github.com/rsella) ([#2892](https://github.com/fishtown-analytics/dbt/issues/2892))

## dbt 0.19.0b1 (October 21, 2020)

Expand Down
3 changes: 2 additions & 1 deletion core/dbt/task/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,5 @@ def get_node_selector(self):
)

def interpret_results(self, results):
return bool(results)
# list command should always return 0 as exit code
return True
4 changes: 2 additions & 2 deletions test/integration/047_dbt_ls_test/test_ls.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def expect_select(self):
results = self.run_dbt_ls(['--resource-type', 'test', '--select', 'outer'])
self.assertEqual(set(results), {'test.schema_test.not_null_outer_id', 'test.schema_test.unique_outer_id'})

self.run_dbt_ls(['--resource-type', 'test', '--select', 'inner'], expect_pass=False)
self.run_dbt_ls(['--resource-type', 'test', '--select', 'inner'], expect_pass=True)

results = self.run_dbt_ls(['--resource-type', 'test', '--select', '+inner'])
self.assertEqual(set(results), {'test.schema_test.not_null_outer_id', 'test.schema_test.unique_outer_id'})
Expand All @@ -450,7 +450,7 @@ def expect_select(self):
results = self.run_dbt_ls(['--select', 'config.incremental_strategy:delete+insert'])
self.assertEqual(set(results), {'test.incremental'})

self.run_dbt_ls(['--select', 'config.incremental_strategy:insert_overwrite'], expect_pass=False)
self.run_dbt_ls(['--select', 'config.incremental_strategy:insert_overwrite'], expect_pass=True)


@use_profile('postgres')
Expand Down
8 changes: 4 additions & 4 deletions test/integration/062_defer_state_test/test_modified_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def setUp(self):

@use_profile('postgres')
def test_postgres_changed_seed_contents_state(self):
results = self.run_dbt(['ls', '--resource-type', 'seed', '--select', 'state:modified', '--state', './state'], strict=False, expect_pass=False)
results = self.run_dbt(['ls', '--resource-type', 'seed', '--select', 'state:modified', '--state', './state'], strict=False, expect_pass=True)
assert len(results) == 0
with open('data/seed.csv') as fp:
fp.readline()
Expand Down Expand Up @@ -106,12 +106,12 @@ def test_postgres_changed_seed_contents_state(self):
with open('data/seed.csv', 'a') as fp:
fp.write(f'{random},test{newline}')

results = self.run_dbt(['ls', '--resource-type', 'seed', '--select', 'state:modified', '--state', './state'], strict=False, expect_pass=False)
results = self.run_dbt(['ls', '--resource-type', 'seed', '--select', 'state:modified', '--state', './state'], strict=False, expect_pass=True)
assert len(results) == 0

@use_profile('postgres')
def test_postgres_changed_seed_config(self):
results = self.run_dbt(['ls', '--resource-type', 'seed', '--select', 'state:modified', '--state', './state'], strict=False, expect_pass=False)
results = self.run_dbt(['ls', '--resource-type', 'seed', '--select', 'state:modified', '--state', './state'], strict=False, expect_pass=True)
assert len(results) == 0

self.use_default_project({'seeds': {'test': {'quote_columns': False}}})
Expand All @@ -123,7 +123,7 @@ def test_postgres_changed_seed_config(self):

@use_profile('postgres')
def test_postgres_unrendered_config_same(self):
results = self.run_dbt(['ls', '--resource-type', 'model', '--select', 'state:modified', '--state', './state'], strict=False, expect_pass=False)
results = self.run_dbt(['ls', '--resource-type', 'model', '--select', 'state:modified', '--state', './state'], strict=False, expect_pass=True)
assert len(results) == 0

# although this is the default value, dbt will recognize it as a change
Expand Down

0 comments on commit ec0f3d2

Please sign in to comment.