Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated string formatting on non-f-strings. #6086

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changes/unreleased/Under the Hood-20221017-151511.yaml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion core/dbt/adapters/base/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
)

###
Expand Down
6 changes: 3 additions & 3 deletions core/dbt/clients/_jinja_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/config/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
)
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/context/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__(
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/contracts/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion core/dbt/contracts/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions core/dbt/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/parser/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/parser/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/task/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/task/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/task/freshness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/task/runnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[],
Expand Down
4 changes: 2 additions & 2 deletions core/dbt/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/artifacts/expected_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down