Skip to content

Commit

Permalink
3.6 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel May committed Oct 26, 2021
1 parent 821d65b commit 496f54e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions core/dbt/events/events.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

from dataclasses import dataclass
from typing import NoReturn, Union
from typing import NamedTuple, NoReturn, Union


# common trick for getting mypy to do exhaustiveness checks
Expand All @@ -9,16 +8,21 @@
def assert_never(x: NoReturn) -> NoReturn:
raise AssertionError("Unhandled type: {}".format(type(x).__name__))

# The following classes represent the data necessary to describe a
# particular event to both human readable logs, and machine reliable
# event streams. The transformation to these forms will live in outside
# functions.
#
# Until we drop support for Python 3.6 we must use NamedTuples over
# frozen dataclasses.

# TODO dummy class
@dataclass(frozen=True)
class OK:
class OK(NamedTuple):
result: int


# TODO dummy class
@dataclass(frozen=True)
class Failure:
class Failure(NamedTuple):
msg: str


Expand Down

0 comments on commit 496f54e

Please sign in to comment.