Skip to content

Commit

Permalink
Merge pull request #2841 from feluelle/dev/kiyoshi-kuromiya
Browse files Browse the repository at this point in the history
Respect --project-dir in dbt clean command
  • Loading branch information
jtcohen6 authored Oct 21, 2020
2 parents b188a94 + 63d25aa commit ecadc74
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
## dbt 0.19.0 (Release TBD)

## dbt 0.19.0b1 (October 21, 2020)
### Fixes
- Respect --project-dir in dbt clean command ([#2840](https://github.com/fishtown-analytics/dbt/issues/2840), [#2841](https://github.com/fishtown-analytics/dbt/pull/2841))

Contributors:
- [@feluelle](https://github.com/feluelle) ([#2841](https://github.com/fishtown-analytics/dbt/pull/2841))

## dbt 0.19.0b1 (October 21, 2020)

### Breaking changes
- The format for sources.json, run-results.json, manifest.json, and catalog.json has changed to include a common metadata field ([#2761](https://github.com/fishtown-analytics/dbt/issues/2761), [#2778](https://github.com/fishtown-analytics/dbt/pull/2778), [#2763](https://github.com/fishtown-analytics/dbt/issues/2763), [#2784](https://github.com/fishtown-analytics/dbt/pull/2784), [#2764](https://github.com/fishtown-analytics/dbt/issues/2764), [#2785](https://github.com/fishtown-analytics/dbt/pull/2785))
Expand Down Expand Up @@ -32,11 +37,10 @@
Contributors:
- [@joelluijmes](https://github.com/joelluijmes) ([#2749](https://github.com/fishtown-analytics/dbt/pull/2749), [#2821](https://github.com/fishtown-analytics/dbt/pull/2821))
- [@kingfink](https://github.com/kingfink) ([#2791](https://github.com/fishtown-analytics/dbt/pull/2791))
- [@zmac12](https://github.com/zmac12) ([#2871](https://github.com/fishtown-analytics/dbt/pull/2817))
- [@zmac12](https://github.com/zmac12) ([#2817](https://github.com/fishtown-analytics/dbt/pull/2817))
- [@Mr-Nobody99](https://github.com/Mr-Nobody99) ([docs#138](https://github.com/fishtown-analytics/dbt-docs/pull/138))
- [@jplynch77](https://github.com/jplynch77) ([docs#139](https://github.com/fishtown-analytics/dbt-docs/pull/139))


## dbt 0.18.1 (October 13, 2020)

## dbt 0.18.1rc1 (October 01, 2020)
Expand Down
3 changes: 2 additions & 1 deletion core/dbt/task/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import shutil

from dbt.task.base import BaseTask
from dbt.task.base import BaseTask, move_to_nearest_project_dir
from dbt.logger import GLOBAL_LOGGER as logger
from dbt.config import UnsetProfileConfig

Expand Down Expand Up @@ -32,6 +32,7 @@ def run(self):
This function takes all the paths in the target file
and cleans the project paths that are not protected.
"""
move_to_nearest_project_dir(self.args)
for path in self.config.clean_targets:
logger.info("Checking {}/*".format(path))
if not self.__is_protected_path(path):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,7 @@ def _run_simple_dbt_commands(self, project_dir):
self.run_dbt(['seed', '--project-dir', project_dir])
self.run_dbt(['run', '--project-dir', project_dir])
self.run_dbt(['test', '--project-dir', project_dir])
self.run_dbt(['clean', '--project-dir', project_dir])
# In case of 'dbt clean' also test that the clean-targets directories were deleted.
for target in self.config.clean_targets:
assert not os.path.isdir(target)

0 comments on commit ecadc74

Please sign in to comment.