Skip to content

Commit

Permalink
Replace \n prefixes with EmptyLine
Browse files Browse the repository at this point in the history
  • Loading branch information
jtcohen6 committed Dec 2, 2021
1 parent 453831e commit e7c11a2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions core/dbt/events/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ class InvalidVarsYAML(ErrorLevel, Cli, File):
code: str = "A008"

def message(self) -> str:
return "The YAML provided in the --vars argument is not valid.\n"
return "The YAML provided in the --vars argument is not valid."


# TODO: Remove? (appears to be uncalled)
Expand Down Expand Up @@ -1605,7 +1605,7 @@ class DepsNotifyUpdatesAvailable(InfoLevel, Cli, File):
code: str = "M019"

def message(self) -> str:
return ('\nUpdates available for packages: {} \
return ('Updates available for packages: {} \
\nUpdate your versions in packages.yml, then run dbt deps'.format(self.packages))


Expand Down Expand Up @@ -1722,7 +1722,7 @@ class ServingDocsExitInfo(InfoLevel, Cli, File):
code: str = "Z020"

def message(self) -> str:
return "Press Ctrl+C to exit.\n\n"
return "Press Ctrl+C to exit."


@dataclass
Expand Down Expand Up @@ -1773,7 +1773,7 @@ class StatsLine(InfoLevel, Cli, File):
code: str = "Z023"

def message(self) -> str:
stats_line = ("\nDone. PASS={pass} WARN={warn} ERROR={error} SKIP={skip} TOTAL={total}")
stats_line = ("Done. PASS={pass} WARN={warn} ERROR={error} SKIP={skip} TOTAL={total}")
return stats_line.format(**self.stats)


Expand Down
3 changes: 2 additions & 1 deletion core/dbt/task/deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from dbt.events.functions import fire_event
from dbt.events.types import (
DepsNoPackagesFound, DepsStartPackageInstall, DepsUpdateAvailable, DepsUTD,
DepsInstallInfo, DepsListSubdirectory, DepsNotifyUpdatesAvailable
DepsInstallInfo, DepsListSubdirectory, DepsNotifyUpdatesAvailable, EmptyLine
)
from dbt.clients import system

Expand Down Expand Up @@ -81,6 +81,7 @@ def run(self):
source_type=source_type,
version=version)
if packages_to_upgrade:
fire_event(EmptyLine())
fire_event(DepsNotifyUpdatesAvailable(packages=packages_to_upgrade))

@classmethod
Expand Down
2 changes: 2 additions & 0 deletions core/dbt/task/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def print_run_status_line(results) -> None:
stats[result_type] += 1
stats['total'] += 1

with TextOnly():
fire_event(EmptyLine())
fire_event(StatsLine(stats=stats))


Expand Down
4 changes: 3 additions & 1 deletion core/dbt/task/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from http.server import SimpleHTTPRequestHandler
from socketserver import TCPServer
from dbt.events.functions import fire_event
from dbt.events.types import ServingDocsPort, ServingDocsAccessInfo, ServingDocsExitInfo
from dbt.events.types import ServingDocsPort, ServingDocsAccessInfo, ServingDocsExitInfo, EmptyLine

from dbt.task.base import ConfiguredTask

Expand All @@ -22,6 +22,8 @@ def run(self):

fire_event(ServingDocsPort(address=address, port=port))
fire_event(ServingDocsAccessInfo(port=port))
fire_event(EmptyLine())
fire_event(EmptyLine())
fire_event(ServingDocsExitInfo())

# mypy doesn't think SimpleHTTPRequestHandler is ok here, but it is
Expand Down

0 comments on commit e7c11a2

Please sign in to comment.