From 9f3c1ada9fc63ded14a67fc75c51f692d99bd6d2 Mon Sep 17 00:00:00 2001 From: Connor McArthur Date: Fri, 6 Jan 2017 13:05:58 -0500 Subject: [PATCH] pep8 compliance (#257) add pep8 check to continuous integration tests and bring codebase into compliance automatic commit by git-black, original commits: 0e01064a237339779cb40dff6b516d045a2d2463 --- core/dbt/deprecations.py | 4 +--- core/dbt/main.py | 10 +++++----- core/dbt/task/clean.py | 3 +-- core/dbt/tracking.py | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/core/dbt/deprecations.py b/core/dbt/deprecations.py index dba35dbf9ba..82b90961cc9 100644 --- a/core/dbt/deprecations.py +++ b/core/dbt/deprecations.py @@ -90,9 +90,7 @@ class AdapterDeprecationWarning(DBTDeprecation): def warn(name, *args, **kwargs): if name not in deprecations: # this should (hopefully) never happen - raise RuntimeError( - "Error showing deprecation warning: {}".format(name) - ) + raise RuntimeError("Error showing deprecation warning: {}".format(name)) deprecations[name].show(*args, **kwargs) diff --git a/core/dbt/main.py b/core/dbt/main.py index 02989652091..b1ebea68faa 100644 --- a/core/dbt/main.py +++ b/core/dbt/main.py @@ -199,7 +199,7 @@ def track_run(task): dbt.tracking.track_invocation_start(config=task.config, args=task.args) try: yield - dbt.tracking.track_invocation_end( + dbt.tracking.track_invocation_end(config=task.config, args=task.args, result_type="ok") config=task.config, args=task.args, result_type="ok" ) except (NotImplementedException, @@ -260,7 +260,7 @@ def _build_base_subparser(): ) base_subparser.add_argument( - '--profiles-dir', + "--profiles-dir", default=None, dest="sub_profiles_dir", # Main cli arg precedes subcommand type=str, @@ -272,7 +272,7 @@ def _build_base_subparser(): ) base_subparser.add_argument( - '--profile', + "--profile", required=False, type=str, help=''' @@ -282,7 +282,7 @@ def _build_base_subparser(): base_subparser.add_argument( '-t', - '--target', + "--target", default=None, type=str, help=''' @@ -478,7 +478,7 @@ def _build_snapshot_subparser(subparsers, base_subparser): ''', ) sub.add_argument( - '--threads', + "--threads", type=int, required=False, help=''' diff --git a/core/dbt/task/clean.py b/core/dbt/task/clean.py index 299a15127e7..27aab21b8d4 100644 --- a/core/dbt/task/clean.py +++ b/core/dbt/task/clean.py @@ -28,8 +28,7 @@ def __is_protected_path(self, path): protected_paths = self.config.model_paths + \ self.config.test_paths + ['.'] protected_abs_paths = [os.path.abspath(p) for p in protected_paths] - return abs_path in set(protected_abs_paths) or \ - self.__is_project_path(abs_path) + return abs_path in set(protected_abs_paths) or self.__is_project_path(abs_path) def run(self): """ diff --git a/core/dbt/tracking.py b/core/dbt/tracking.py index ce8444223c7..ba0b53cd498 100644 --- a/core/dbt/tracking.py +++ b/core/dbt/tracking.py @@ -402,7 +402,7 @@ def track_invocation_end( ) -def track_invalid_invocation( +def track_invalid_invocation(config=None, args=None, result_type=None): config=None, args=None, result_type=None ): assert active_user is not None, \