Skip to content

Commit

Permalink
Events with graph_func include actual output of graph_func (#4360)
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank authored Nov 30, 2021
1 parent 3a904a8 commit 31691c3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/dbt/events/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
)
from dbt.events.format import format_fancy_output_line, pluralize
from dbt.node_types import NodeType
from typing import Any, Callable, cast, Dict, List, Optional, Set, Tuple, TypeVar
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, TypeVar


# The classes in this file represent the data necessary to describe a
Expand Down Expand Up @@ -734,7 +734,7 @@ class DumpBeforeAddGraph(DebugLevel, Cli, File):
def message(self) -> str:
# workaround for https://github.com/python/mypy/issues/6910
# TODO remove when we've upgraded to a mypy version without that bug
func_returns = cast(Callable[[], Dict[str, List[str]]], getattr(self, "graph_func"))
func_returns = self.graph_func() # type: ignore
return f"before adding : {func_returns}"

# TODO should we manually cache the graph here so it doesn't get called for the message
Expand All @@ -755,7 +755,7 @@ class DumpAfterAddGraph(DebugLevel, Cli, File):

def message(self) -> str:
# workaround for https://github.com/python/mypy/issues/6910
func_returns = cast(Callable[[], Dict[str, List[str]]], getattr(self, "graph_func"))
func_returns = self.graph_func() # type: ignore
return f"after adding: {func_returns}"

# TODO should we manually cache the graph here so it doesn't get called for the message
Expand All @@ -776,7 +776,7 @@ class DumpBeforeRenameSchema(DebugLevel, Cli, File):

def message(self) -> str:
# workaround for https://github.com/python/mypy/issues/6910
func_returns = cast(Callable[[], Dict[str, List[str]]], getattr(self, "graph_func"))
func_returns = self.graph_func() # type: ignore
return f"before rename: {func_returns}"

def fields_to_json(self, val: Any) -> Any:
Expand All @@ -793,7 +793,7 @@ class DumpAfterRenameSchema(DebugLevel, Cli, File):

def message(self) -> str:
# workaround for https://github.com/python/mypy/issues/6910
func_returns = cast(Callable[[], Dict[str, List[str]]], getattr(self, "graph_func"))
func_returns = self.graph_func() # type: ignore
return f"after rename: {func_returns}"

def fields_to_json(self, val: Any) -> Any:
Expand Down

0 comments on commit 31691c3

Please sign in to comment.