diff --git a/.changes/unreleased/Under the Hood-20221017-151511.yaml b/.changes/unreleased/Under the Hood-20221017-151511.yaml new file mode 100644 index 00000000000..cbdcf04beb3 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20221017-151511.yaml @@ -0,0 +1,7 @@ +kind: Under the Hood +body: Fixed extra whitespace in strings introduced by black. +time: 2022-10-17T15:15:11.499246-05:00 +custom: + Author: luke-bassett + Issue: "1350" + PR: "6086" diff --git a/core/dbt/adapters/base/impl.py b/core/dbt/adapters/base/impl.py index 3f8a1e6f78f..3c301c2e7f4 100644 --- a/core/dbt/adapters/base/impl.py +++ b/core/dbt/adapters/base/impl.py @@ -581,7 +581,7 @@ def list_relations_without_caching(self, schema_relation: BaseRelation) -> List[ :rtype: List[self.Relation] """ raise NotImplementedException( - "`list_relations_without_caching` is not implemented for this " "adapter!" + "`list_relations_without_caching` is not implemented for this adapter!" ) ### diff --git a/core/dbt/clients/_jinja_blocks.py b/core/dbt/clients/_jinja_blocks.py index 761c6dfcb4d..c1ef31acf44 100644 --- a/core/dbt/clients/_jinja_blocks.py +++ b/core/dbt/clients/_jinja_blocks.py @@ -367,9 +367,9 @@ def find_blocks(self, allowed_blocks=None, collect_raw_data=True): if self.current: linecount = self.data[: self.current.end].count("\n") + 1 dbt.exceptions.raise_compiler_error( - ( - "Reached EOF without finding a close tag for " "{} (searched from line {})" - ).format(self.current.block_type_name, linecount) + ("Reached EOF without finding a close tag for {} (searched from line {})").format( + self.current.block_type_name, linecount + ) ) if collect_raw_data: diff --git a/core/dbt/config/project.py b/core/dbt/config/project.py index d2aaee699a3..45b6357f6ed 100644 --- a/core/dbt/config/project.py +++ b/core/dbt/config/project.py @@ -248,7 +248,7 @@ class PartialProject(RenderComponents): project_name: Optional[str] = field( metadata=dict( description=( - "The name of the project. This should always be set and will not " "be rendered" + "The name of the project. This should always be set and will not be rendered" ) ) ) diff --git a/core/dbt/context/base.py b/core/dbt/context/base.py index bf334a7d11f..68b5edb98c1 100644 --- a/core/dbt/context/base.py +++ b/core/dbt/context/base.py @@ -126,7 +126,7 @@ def __new__(mcls, name, bases, dct): class Var: - UndefinedVarError = "Required var '{}' not found in config:\nVars " "supplied to {} = {}" + UndefinedVarError = "Required var '{}' not found in config:\nVars supplied to {} = {}" _VAR_NOTSET = object() def __init__( diff --git a/core/dbt/contracts/connection.py b/core/dbt/contracts/connection.py index 831230d661d..a32bb443099 100644 --- a/core/dbt/contracts/connection.py +++ b/core/dbt/contracts/connection.py @@ -94,7 +94,7 @@ def handle(self): self._handle.resolve(self) except RecursionError as exc: raise InternalException( - "A connection's open() method attempted to read the " "handle value" + "A connection's open() method attempted to read the handle value" ) from exc return self._handle diff --git a/core/dbt/contracts/results.py b/core/dbt/contracts/results.py index cb0a6e2a67e..a3b7ce2b506 100644 --- a/core/dbt/contracts/results.py +++ b/core/dbt/contracts/results.py @@ -339,7 +339,7 @@ def process_freshness_result(result: FreshnessNodeResult) -> FreshnessNodeOutput criteria = result.node.freshness if criteria is None: raise InternalException( - "Somehow evaluated a freshness result for a source " "that has no freshness criteria!" + "Somehow evaluated a freshness result for a source that has no freshness criteria!" ) return SourceFreshnessOutput( unique_id=unique_id, diff --git a/core/dbt/graph/graph.py b/core/dbt/graph/graph.py index acfc43c2142..2dda596e073 100644 --- a/core/dbt/graph/graph.py +++ b/core/dbt/graph/graph.py @@ -90,7 +90,7 @@ def get_subset_graph(self, selected: Iterable[UniqueId]) -> "Graph": for node in include_nodes: if node not in new_graph: raise ValueError( - "Couldn't find model '{}' -- does it exist or is " "it disabled?".format(node) + "Couldn't find model '{}' -- does it exist or is it disabled?".format(node) ) return Graph(new_graph) diff --git a/core/dbt/logger.py b/core/dbt/logger.py index 3787b9a769b..4bbcfca4c06 100644 --- a/core/dbt/logger.py +++ b/core/dbt/logger.py @@ -28,9 +28,7 @@ colorama.init(wrap=True) STDOUT_LOG_FORMAT = "{record.message}" -DEBUG_LOG_FORMAT = ( - "{record.time:%Y-%m-%d %H:%M:%S.%f%z} " "({record.thread_name}): " "{record.message}" -) +DEBUG_LOG_FORMAT = "{record.time:%Y-%m-%d %H:%M:%S.%f%z} ({record.thread_name}): {record.message}" def get_secret_env() -> List[str]: diff --git a/core/dbt/parser/schemas.py b/core/dbt/parser/schemas.py index b73722952ce..8b22427cb39 100644 --- a/core/dbt/parser/schemas.py +++ b/core/dbt/parser/schemas.py @@ -298,7 +298,7 @@ def _parse_generic_test( except ParsingException as exc: context = _trimmed(str(target)) - msg = "Invalid test config given in {}:" "\n\t{}\n\t@: {}".format( + msg = "Invalid test config given in {}:\n\t{}\n\t@: {}".format( target.original_file_path, exc.msg, context ) raise ParsingException(msg) from exc diff --git a/core/dbt/parser/sources.py b/core/dbt/parser/sources.py index 4757edab31e..a2bdc443bbf 100644 --- a/core/dbt/parser/sources.py +++ b/core/dbt/parser/sources.py @@ -317,7 +317,7 @@ def get_unused_msg( unused_tables: Dict[SourceKey, Optional[Set[str]]], ) -> str: msg = [ - "During parsing, dbt encountered source overrides that had no " "target:", + "During parsing, dbt encountered source overrides that had no target:", ] for key, table_names in unused_tables.items(): patch = self.manifest.source_patches[key] diff --git a/core/dbt/task/base.py b/core/dbt/task/base.py index b20dd76b10d..1b067d79af8 100644 --- a/core/dbt/task/base.py +++ b/core/dbt/task/base.py @@ -461,7 +461,7 @@ def on_skip(self): print_run_result_error(result=self.skip_cause, newline=False) if self.skip_cause is None: # mypy appeasement raise InternalException( - "Skip cause not set but skip was somehow caused by " "an ephemeral failure" + "Skip cause not set but skip was somehow caused by an ephemeral failure" ) # set an error so dbt will exit with an error code error_message = ( diff --git a/core/dbt/task/compile.py b/core/dbt/task/compile.py index b091ae76099..740d35d37e9 100644 --- a/core/dbt/task/compile.py +++ b/core/dbt/task/compile.py @@ -64,7 +64,7 @@ def _get_deferred_manifest(self) -> Optional[WritableManifest]: state = self.previous_state if state is None: raise RuntimeException( - "Received a --defer argument, but no value was provided " "to --state" + "Received a --defer argument, but no value was provided to --state" ) if state.manifest is None: @@ -77,7 +77,7 @@ def defer_to_manifest(self, adapter, selected_uids: AbstractSet[str]): return if self.manifest is None: raise InternalException( - "Expected to defer to manifest, but there is no runtime " "manifest to defer from!" + "Expected to defer to manifest, but there is no runtime manifest to defer from!" ) self.manifest.merge_from_artifact( adapter=adapter, diff --git a/core/dbt/task/freshness.py b/core/dbt/task/freshness.py index fa16bc5dd80..ab256334271 100644 --- a/core/dbt/task/freshness.py +++ b/core/dbt/task/freshness.py @@ -135,7 +135,7 @@ def execute(self, compiled_node, manifest): # broken, raise! if compiled_node.loaded_at_field is None: raise InternalException( - "Got to execute for source freshness of a source that has no " "loaded_at_field!" + "Got to execute for source freshness of a source that has no loaded_at_field!" ) relation = self.adapter.Relation.create_from_source(compiled_node) diff --git a/core/dbt/task/runnable.py b/core/dbt/task/runnable.py index 39289b3cacb..914f3b5d65e 100644 --- a/core/dbt/task/runnable.py +++ b/core/dbt/task/runnable.py @@ -459,7 +459,7 @@ def run(self): if len(self._flattened_nodes) == 0: with TextOnly(): fire_event(EmptyLine()) - msg = "Nothing to do. Try checking your model " "configs and model specification args" + msg = "Nothing to do. Try checking your model configs and model specification args" warn_or_error(msg, log_fmt=warning_tag("{}")) result = self.get_result( results=[], diff --git a/core/dbt/utils.py b/core/dbt/utils.py index ccae3601446..b7cc6475319 100644 --- a/core/dbt/utils.py +++ b/core/dbt/utils.py @@ -491,11 +491,11 @@ def submit(*args, **kwargs): self, fn, *args = args elif not args: raise TypeError( - "descriptor 'submit' of 'SingleThreadedExecutor' object needs " "an argument" + "descriptor 'submit' of 'SingleThreadedExecutor' object needs an argument" ) else: raise TypeError( - "submit expected at least 1 positional argument, " "got %d" % (len(args) - 1) + "submit expected at least 1 positional argument, got %d" % (len(args) - 1) ) fut = concurrent.futures.Future() try: diff --git a/tests/functional/artifacts/expected_manifest.py b/tests/functional/artifacts/expected_manifest.py index 23e396400e9..32c9dcfbfa1 100644 --- a/tests/functional/artifacts/expected_manifest.py +++ b/tests/functional/artifacts/expected_manifest.py @@ -1275,7 +1275,7 @@ def expected_references_manifest(project): }, "test.view_summary": { "block_contents": ( - "A view of the summary of the ephemeral copy of the " "seed data" + "A view of the summary of the ephemeral copy of the seed data" ), "name": "view_summary", "original_file_path": docs_path,