Skip to content

Commit

Permalink
remove some logic
Browse files Browse the repository at this point in the history
  • Loading branch information
emmyoop committed Feb 6, 2024
1 parent 50555ee commit 6148b50
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions dbt_common/events/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import json
import os
import sys
from typing import Callable, Dict, Optional, TextIO, Union
from typing import Dict, Optional, TextIO, Union
from google.protobuf.json_format import MessageToDict

LOG_VERSION = 3
Expand Down Expand Up @@ -123,22 +123,6 @@ def warn_or_error(event, node=None) -> None:
fire_event(event)


# an alternative to fire_event which only creates and logs the event value
# if the condition is met. Does nothing otherwise.
def fire_event_if(
conditional: bool, lazy_e: Callable[[], BaseEvent], level: Optional[EventLevel] = None
) -> None:
if conditional:
fire_event(lazy_e(), level=level)


# a special case of fire_event_if, to only fire events in our unit/functional tests
def fire_event_if_test(
lazy_e: Callable[[], BaseEvent], level: Optional[EventLevel] = None
) -> None:
fire_event_if(conditional=("pytest" in sys.modules), lazy_e=lazy_e, level=level)


# top-level method for accessing the new eventing system
# this is where all the side effects happen branched by event type
# (i.e. - mutating the event history, printing to stdout, logging
Expand Down

0 comments on commit 6148b50

Please sign in to comment.