dbt-common 1.0.3__py3-none-any.whl → 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dbt_common/__about__.py CHANGED
@@ -1 +1 @@
1
- version = "1.0.3"
1
+ version = "1.1.0"
@@ -1,10 +1,10 @@
1
1
  from dataclasses import dataclass, field
2
- from typing import Dict, Any
2
+ from typing import Dict, Any, Optional
3
3
 
4
- from dbt_common.dataclass_schema import ExtensibleDbtClassMixin
4
+ from dbt_common.dataclass_schema import ExtensibleDbtClassMixin, dbtClassMixin
5
5
 
6
6
 
7
- class AdditionalPropertiesMixin:
7
+ class AdditionalPropertiesMixin(dbtClassMixin):
8
8
  """Make this class an extensible property.
9
9
 
10
10
  The underlying class definition must include a type definition for a field
@@ -41,8 +41,8 @@ class AdditionalPropertiesMixin:
41
41
  data = super().__pre_deserialize__(data)
42
42
  return data
43
43
 
44
- def __post_serialize__(self, dct):
45
- data = super().__post_serialize__(dct)
44
+ def __post_serialize__(self, dct: Dict, context: Optional[Dict] = None):
45
+ data = super().__post_serialize__(dct, context)
46
46
  data.update(self.extra)
47
47
  if "_extra" in data:
48
48
  del data["_extra"]
@@ -7,11 +7,17 @@ from datetime import datetime
7
7
  from dateutil.parser import parse
8
8
 
9
9
  # type: ignore
10
- from mashumaro import DataClassDictMixin
11
- from mashumaro.config import TO_DICT_ADD_OMIT_NONE_FLAG, BaseConfig as MashBaseConfig
10
+ from mashumaro.config import (
11
+ TO_DICT_ADD_OMIT_NONE_FLAG,
12
+ ADD_SERIALIZATION_CONTEXT,
13
+ BaseConfig as MashBaseConfig,
14
+ )
12
15
  from mashumaro.types import SerializableType, SerializationStrategy
13
16
  from mashumaro.jsonschema import build_json_schema
14
17
 
18
+ # following includes DataClassDictMixin
19
+ from mashumaro.mixins.msgpack import DataClassMessagePackMixin
20
+
15
21
  import functools
16
22
 
17
23
 
@@ -34,6 +40,7 @@ class DateTimeSerialization(SerializationStrategy):
34
40
  class dbtMashConfig(MashBaseConfig):
35
41
  code_generation_options = [
36
42
  TO_DICT_ADD_OMIT_NONE_FLAG,
43
+ ADD_SERIALIZATION_CONTEXT,
37
44
  ]
38
45
  serialization_strategy = {
39
46
  datetime: DateTimeSerialization(),
@@ -47,7 +54,8 @@ class dbtMashConfig(MashBaseConfig):
47
54
 
48
55
  # This class pulls in DataClassDictMixin from Mashumaro. The 'to_dict'
49
56
  # and 'from_dict' methods come from Mashumaro.
50
- class dbtClassMixin(DataClassDictMixin):
57
+ # Note: DataClassMessagePackMixin inherits from DataClassDictMixin
58
+ class dbtClassMixin(DataClassMessagePackMixin):
51
59
  """Convert and validate JSON schemas.
52
60
 
53
61
  The Mixin adds methods to generate a JSON schema and
@@ -73,7 +81,7 @@ class dbtClassMixin(DataClassDictMixin):
73
81
  # This is called by the mashumaro to_dict in order to handle
74
82
  # nested classes. We no longer do any munging here, but leaving here
75
83
  # so that subclasses can leave super() in place for possible future needs.
76
- def __post_serialize__(self, data):
84
+ def __post_serialize__(self, data, context: Optional[Dict]):
77
85
  return data
78
86
 
79
87
  @classmethod
@@ -6,14 +6,11 @@ import sys
6
6
  from google.protobuf.json_format import ParseDict, MessageToDict, MessageToJson
7
7
  from google.protobuf.message import Message
8
8
  from dbt_common.events.helpers import get_json_string_utcnow
9
- from typing import Optional
9
+ from typing import Callable, Optional
10
10
 
11
11
  from dbt_common.invocation import get_invocation_id
12
12
 
13
- if sys.version_info >= (3, 8):
14
- from typing import Protocol
15
- else:
16
- from typing_extensions import Protocol
13
+ from typing import Protocol
17
14
 
18
15
 
19
16
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@@ -128,6 +125,9 @@ class EventMsg(Protocol):
128
125
  data: Message
129
126
 
130
127
 
128
+ TCallback = Callable[[EventMsg], None]
129
+
130
+
131
131
  def msg_from_base_event(event: BaseEvent, level: Optional[EventLevel] = None):
132
132
  msg_class_name = f"{type(event).__name__}Msg"
133
133
  msg_cls = getattr(event.PROTO_TYPES_MODULE, msg_class_name)
@@ -1,15 +1,15 @@
1
1
  import os
2
2
  import traceback
3
- from typing import Callable, List, Optional, Protocol, Tuple
3
+ from typing import List, Optional, Protocol, Tuple
4
4
 
5
- from dbt_common.events.base_types import BaseEvent, EventLevel, msg_from_base_event, EventMsg
5
+ from dbt_common.events.base_types import BaseEvent, EventLevel, msg_from_base_event, TCallback
6
6
  from dbt_common.events.logger import LoggerConfig, _Logger, _TextLogger, _JsonLogger, LineFormat
7
7
 
8
8
 
9
9
  class EventManager:
10
10
  def __init__(self) -> None:
11
11
  self.loggers: List[_Logger] = []
12
- self.callbacks: List[Callable[[EventMsg], None]] = []
12
+ self.callbacks: List[TCallback] = []
13
13
 
14
14
  def fire_event(self, e: BaseEvent, level: Optional[EventLevel] = None) -> None:
15
15
  msg = msg_from_base_event(e, level=level)
@@ -37,13 +37,16 @@ class EventManager:
37
37
  )
38
38
  self.loggers.append(logger)
39
39
 
40
+ def add_callback(self, callback: TCallback) -> None:
41
+ self.callbacks.append(callback)
42
+
40
43
  def flush(self) -> None:
41
44
  for logger in self.loggers:
42
45
  logger.flush()
43
46
 
44
47
 
45
48
  class IEventManager(Protocol):
46
- callbacks: List[Callable[[EventMsg], None]]
49
+ callbacks: List[TCallback]
47
50
  loggers: List[_Logger]
48
51
 
49
52
  def fire_event(self, e: BaseEvent, level: Optional[EventLevel] = None) -> None:
@@ -52,6 +55,9 @@ class IEventManager(Protocol):
52
55
  def add_logger(self, config: LoggerConfig) -> None:
53
56
  ...
54
57
 
58
+ def add_callback(self, callback: TCallback) -> None:
59
+ ...
60
+
55
61
 
56
62
  class TestEventManager(IEventManager):
57
63
  __test__ = False
@@ -1,6 +1,7 @@
1
1
  # Since dbt-rpc does not do its own log setup, and since some events can
2
2
  # currently fire before logs can be configured by setup_event_logger(), we
3
3
  # create a default configuration with default settings and no file output.
4
+ from dbt_common.events.base_types import TCallback
4
5
  from dbt_common.events.event_manager import IEventManager, EventManager
5
6
 
6
7
  _EVENT_MANAGER: IEventManager = EventManager()
@@ -16,6 +17,11 @@ def add_logger_to_manager(logger) -> None:
16
17
  _EVENT_MANAGER.add_logger(logger)
17
18
 
18
19
 
20
+ def add_callback_to_manager(callback: TCallback) -> None:
21
+ global _EVENT_MANAGER
22
+ _EVENT_MANAGER.add_callback(callback)
23
+
24
+
19
25
  def ctx_set_event_manager(event_manager: IEventManager) -> None:
20
26
  global _EVENT_MANAGER
21
27
  _EVENT_MANAGER = event_manager
@@ -13,6 +13,13 @@ from dbt_common.events.base_types import EventLevel, EventMsg
13
13
  from dbt_common.events.format import timestamp_to_datetime_string
14
14
  from dbt_common.utils.encoding import ForgivingJSONEncoder
15
15
 
16
+ PRINT_EVENT_NAME = "PrintEvent"
17
+
18
+
19
+ def _is_print_event(msg: EventMsg) -> bool:
20
+ return msg.info.name == PRINT_EVENT_NAME
21
+
22
+
16
23
  # A Filter is a function which takes a BaseEvent and returns True if the event
17
24
  # should be logged, False otherwise.
18
25
  Filter = Callable[[EventMsg], bool]
@@ -120,7 +127,14 @@ class _Logger:
120
127
  def write_line(self, msg: EventMsg):
121
128
  line = self.create_line(msg)
122
129
  if self._python_logger is not None:
123
- send_to_logger(self._python_logger, msg.info.level, line)
130
+ # We send PrintEvent to logger as error so it goes to stdout
131
+ # when --quiet flag is set.
132
+ # --quiet flag will filter out all events lower than ERROR.
133
+ if _is_print_event(msg):
134
+ level = "error"
135
+ else:
136
+ level = msg.info.level
137
+ send_to_logger(self._python_logger, level, line)
124
138
 
125
139
  def flush(self):
126
140
  if self._python_logger is not None:
@@ -138,8 +152,11 @@ class _TextLogger(_Logger):
138
152
  return self.create_debug_line(msg) if self.use_debug_format else self.create_info_line(msg)
139
153
 
140
154
  def create_info_line(self, msg: EventMsg) -> str:
141
- ts: str = datetime.utcnow().strftime("%H:%M:%S")
142
155
  scrubbed_msg: str = self.scrubber(msg.info.msg) # type: ignore
156
+ if _is_print_event(msg):
157
+ # PrintEvent is a special case, we don't want to add a timestamp
158
+ return scrubbed_msg
159
+ ts: str = datetime.utcnow().strftime("%H:%M:%S")
143
160
  return f"{self._get_color_tag()}{ts} {scrubbed_msg}"
144
161
 
145
162
  def create_debug_line(self, msg: EventMsg) -> str:
@@ -119,3 +119,13 @@ message NoteMsg {
119
119
  EventInfo info = 1;
120
120
  Note data = 2;
121
121
  }
122
+
123
+ // Z052
124
+ message PrintEvent {
125
+ string msg = 1;
126
+ }
127
+
128
+ message PrintEventMsg {
129
+ EventInfo info = 1;
130
+ PrintEvent data = 2;
131
+ }
@@ -125,3 +125,14 @@ class Note(InfoLevel):
125
125
 
126
126
  def message(self) -> str:
127
127
  return self.msg
128
+
129
+
130
+ class PrintEvent(InfoLevel):
131
+ # Use this event to skip any formatting and just print a message
132
+ # This event will get to stdout even if the logger is set to ERROR
133
+ # This is to support commands that want --quiet option but also log something to stdout
134
+ def code(self) -> str:
135
+ return "Z052"
136
+
137
+ def message(self) -> str:
138
+ return self.msg
@@ -1,11 +1,12 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
3
3
  # source: types.proto
4
+ # Protobuf Python Version: 5.26.1
4
5
  """Generated protocol buffer code."""
5
- from google.protobuf.internal import builder as _builder
6
6
  from google.protobuf import descriptor as _descriptor
7
7
  from google.protobuf import descriptor_pool as _descriptor_pool
8
8
  from google.protobuf import symbol_database as _symbol_database
9
+ from google.protobuf.internal import builder as _builder
9
10
  # @@protoc_insertion_point(imports)
10
11
 
11
12
  _sym_db = _symbol_database.Default()
@@ -14,55 +15,59 @@ _sym_db = _symbol_database.Default()
14
15
  from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
15
16
 
16
17
 
17
- DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btypes.proto\x12\x0bproto_types\x1a\x1fgoogle/protobuf/timestamp.proto\"\x91\x02\n\tEventInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\t\x12\x0b\n\x03msg\x18\x03 \x01(\t\x12\r\n\x05level\x18\x04 \x01(\t\x12\x15\n\rinvocation_id\x18\x05 \x01(\t\x12\x0b\n\x03pid\x18\x06 \x01(\x05\x12\x0e\n\x06thread\x18\x07 \x01(\t\x12&\n\x02ts\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x05\x65xtra\x18\t \x03(\x0b\x32!.proto_types.EventInfo.ExtraEntry\x12\x10\n\x08\x63\x61tegory\x18\n \x01(\t\x1a,\n\nExtraEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"6\n\x0eGenericMessage\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\"1\n\x11RetryExternalCall\x12\x0f\n\x07\x61ttempt\x18\x01 \x01(\x05\x12\x0b\n\x03max\x18\x02 \x01(\x05\"j\n\x14RetryExternalCallMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12,\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x1e.proto_types.RetryExternalCall\"#\n\x14RecordRetryException\x12\x0b\n\x03\x65xc\x18\x01 \x01(\t\"p\n\x17RecordRetryExceptionMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12/\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32!.proto_types.RecordRetryException\"@\n\x13SystemCouldNotWrite\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x0b\n\x03\x65xc\x18\x03 \x01(\t\"n\n\x16SystemCouldNotWriteMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12.\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32 .proto_types.SystemCouldNotWrite\"!\n\x12SystemExecutingCmd\x12\x0b\n\x03\x63md\x18\x01 \x03(\t\"l\n\x15SystemExecutingCmdMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12-\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x1f.proto_types.SystemExecutingCmd\"\x1c\n\x0cSystemStdOut\x12\x0c\n\x04\x62msg\x18\x01 \x01(\t\"`\n\x0fSystemStdOutMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12\'\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x19.proto_types.SystemStdOut\"\x1c\n\x0cSystemStdErr\x12\x0c\n\x04\x62msg\x18\x01 \x01(\t\"`\n\x0fSystemStdErrMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12\'\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x19.proto_types.SystemStdErr\",\n\x16SystemReportReturnCode\x12\x12\n\nreturncode\x18\x01 \x01(\x05\"t\n\x19SystemReportReturnCodeMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12\x31\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32#.proto_types.SystemReportReturnCode\"\x19\n\nFormatting\x12\x0b\n\x03msg\x18\x01 \x01(\t\"\\\n\rFormattingMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12%\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.proto_types.Formatting\"\x13\n\x04Note\x12\x0b\n\x03msg\x18\x01 \x01(\t\"P\n\x07NoteMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12\x1f\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x11.proto_types.Noteb\x06proto3')
18
-
19
- _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
20
- _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'types_pb2', globals())
21
- if _descriptor._USE_C_DESCRIPTORS == False:
18
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0btypes.proto\x12\x0bproto_types\x1a\x1fgoogle/protobuf/timestamp.proto\"\x91\x02\n\tEventInfo\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04\x63ode\x18\x02 \x01(\t\x12\x0b\n\x03msg\x18\x03 \x01(\t\x12\r\n\x05level\x18\x04 \x01(\t\x12\x15\n\rinvocation_id\x18\x05 \x01(\t\x12\x0b\n\x03pid\x18\x06 \x01(\x05\x12\x0e\n\x06thread\x18\x07 \x01(\t\x12&\n\x02ts\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x05\x65xtra\x18\t \x03(\x0b\x32!.proto_types.EventInfo.ExtraEntry\x12\x10\n\x08\x63\x61tegory\x18\n \x01(\t\x1a,\n\nExtraEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"6\n\x0eGenericMessage\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\"1\n\x11RetryExternalCall\x12\x0f\n\x07\x61ttempt\x18\x01 \x01(\x05\x12\x0b\n\x03max\x18\x02 \x01(\x05\"j\n\x14RetryExternalCallMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12,\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x1e.proto_types.RetryExternalCall\"#\n\x14RecordRetryException\x12\x0b\n\x03\x65xc\x18\x01 \x01(\t\"p\n\x17RecordRetryExceptionMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12/\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32!.proto_types.RecordRetryException\"@\n\x13SystemCouldNotWrite\x12\x0c\n\x04path\x18\x01 \x01(\t\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12\x0b\n\x03\x65xc\x18\x03 \x01(\t\"n\n\x16SystemCouldNotWriteMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12.\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32 .proto_types.SystemCouldNotWrite\"!\n\x12SystemExecutingCmd\x12\x0b\n\x03\x63md\x18\x01 \x03(\t\"l\n\x15SystemExecutingCmdMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12-\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x1f.proto_types.SystemExecutingCmd\"\x1c\n\x0cSystemStdOut\x12\x0c\n\x04\x62msg\x18\x01 \x01(\t\"`\n\x0fSystemStdOutMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12\'\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x19.proto_types.SystemStdOut\"\x1c\n\x0cSystemStdErr\x12\x0c\n\x04\x62msg\x18\x01 \x01(\t\"`\n\x0fSystemStdErrMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12\'\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x19.proto_types.SystemStdErr\",\n\x16SystemReportReturnCode\x12\x12\n\nreturncode\x18\x01 \x01(\x05\"t\n\x19SystemReportReturnCodeMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12\x31\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32#.proto_types.SystemReportReturnCode\"\x19\n\nFormatting\x12\x0b\n\x03msg\x18\x01 \x01(\t\"\\\n\rFormattingMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12%\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.proto_types.Formatting\"\x13\n\x04Note\x12\x0b\n\x03msg\x18\x01 \x01(\t\"P\n\x07NoteMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12\x1f\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x11.proto_types.Note\"\x19\n\nPrintEvent\x12\x0b\n\x03msg\x18\x01 \x01(\t\"\\\n\rPrintEventMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12%\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.proto_types.PrintEventb\x06proto3')
22
19
 
23
- DESCRIPTOR._options = None
24
- _EVENTINFO_EXTRAENTRY._options = None
25
- _EVENTINFO_EXTRAENTRY._serialized_options = b'8\001'
26
- _EVENTINFO._serialized_start=62
27
- _EVENTINFO._serialized_end=335
28
- _EVENTINFO_EXTRAENTRY._serialized_start=291
29
- _EVENTINFO_EXTRAENTRY._serialized_end=335
30
- _GENERICMESSAGE._serialized_start=337
31
- _GENERICMESSAGE._serialized_end=391
32
- _RETRYEXTERNALCALL._serialized_start=393
33
- _RETRYEXTERNALCALL._serialized_end=442
34
- _RETRYEXTERNALCALLMSG._serialized_start=444
35
- _RETRYEXTERNALCALLMSG._serialized_end=550
36
- _RECORDRETRYEXCEPTION._serialized_start=552
37
- _RECORDRETRYEXCEPTION._serialized_end=587
38
- _RECORDRETRYEXCEPTIONMSG._serialized_start=589
39
- _RECORDRETRYEXCEPTIONMSG._serialized_end=701
40
- _SYSTEMCOULDNOTWRITE._serialized_start=703
41
- _SYSTEMCOULDNOTWRITE._serialized_end=767
42
- _SYSTEMCOULDNOTWRITEMSG._serialized_start=769
43
- _SYSTEMCOULDNOTWRITEMSG._serialized_end=879
44
- _SYSTEMEXECUTINGCMD._serialized_start=881
45
- _SYSTEMEXECUTINGCMD._serialized_end=914
46
- _SYSTEMEXECUTINGCMDMSG._serialized_start=916
47
- _SYSTEMEXECUTINGCMDMSG._serialized_end=1024
48
- _SYSTEMSTDOUT._serialized_start=1026
49
- _SYSTEMSTDOUT._serialized_end=1054
50
- _SYSTEMSTDOUTMSG._serialized_start=1056
51
- _SYSTEMSTDOUTMSG._serialized_end=1152
52
- _SYSTEMSTDERR._serialized_start=1154
53
- _SYSTEMSTDERR._serialized_end=1182
54
- _SYSTEMSTDERRMSG._serialized_start=1184
55
- _SYSTEMSTDERRMSG._serialized_end=1280
56
- _SYSTEMREPORTRETURNCODE._serialized_start=1282
57
- _SYSTEMREPORTRETURNCODE._serialized_end=1326
58
- _SYSTEMREPORTRETURNCODEMSG._serialized_start=1328
59
- _SYSTEMREPORTRETURNCODEMSG._serialized_end=1444
60
- _FORMATTING._serialized_start=1446
61
- _FORMATTING._serialized_end=1471
62
- _FORMATTINGMSG._serialized_start=1473
63
- _FORMATTINGMSG._serialized_end=1565
64
- _NOTE._serialized_start=1567
65
- _NOTE._serialized_end=1586
66
- _NOTEMSG._serialized_start=1588
67
- _NOTEMSG._serialized_end=1668
20
+ _globals = globals()
21
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
22
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'types_pb2', _globals)
23
+ if not _descriptor._USE_C_DESCRIPTORS:
24
+ DESCRIPTOR._loaded_options = None
25
+ _globals['_EVENTINFO_EXTRAENTRY']._loaded_options = None
26
+ _globals['_EVENTINFO_EXTRAENTRY']._serialized_options = b'8\001'
27
+ _globals['_EVENTINFO']._serialized_start=62
28
+ _globals['_EVENTINFO']._serialized_end=335
29
+ _globals['_EVENTINFO_EXTRAENTRY']._serialized_start=291
30
+ _globals['_EVENTINFO_EXTRAENTRY']._serialized_end=335
31
+ _globals['_GENERICMESSAGE']._serialized_start=337
32
+ _globals['_GENERICMESSAGE']._serialized_end=391
33
+ _globals['_RETRYEXTERNALCALL']._serialized_start=393
34
+ _globals['_RETRYEXTERNALCALL']._serialized_end=442
35
+ _globals['_RETRYEXTERNALCALLMSG']._serialized_start=444
36
+ _globals['_RETRYEXTERNALCALLMSG']._serialized_end=550
37
+ _globals['_RECORDRETRYEXCEPTION']._serialized_start=552
38
+ _globals['_RECORDRETRYEXCEPTION']._serialized_end=587
39
+ _globals['_RECORDRETRYEXCEPTIONMSG']._serialized_start=589
40
+ _globals['_RECORDRETRYEXCEPTIONMSG']._serialized_end=701
41
+ _globals['_SYSTEMCOULDNOTWRITE']._serialized_start=703
42
+ _globals['_SYSTEMCOULDNOTWRITE']._serialized_end=767
43
+ _globals['_SYSTEMCOULDNOTWRITEMSG']._serialized_start=769
44
+ _globals['_SYSTEMCOULDNOTWRITEMSG']._serialized_end=879
45
+ _globals['_SYSTEMEXECUTINGCMD']._serialized_start=881
46
+ _globals['_SYSTEMEXECUTINGCMD']._serialized_end=914
47
+ _globals['_SYSTEMEXECUTINGCMDMSG']._serialized_start=916
48
+ _globals['_SYSTEMEXECUTINGCMDMSG']._serialized_end=1024
49
+ _globals['_SYSTEMSTDOUT']._serialized_start=1026
50
+ _globals['_SYSTEMSTDOUT']._serialized_end=1054
51
+ _globals['_SYSTEMSTDOUTMSG']._serialized_start=1056
52
+ _globals['_SYSTEMSTDOUTMSG']._serialized_end=1152
53
+ _globals['_SYSTEMSTDERR']._serialized_start=1154
54
+ _globals['_SYSTEMSTDERR']._serialized_end=1182
55
+ _globals['_SYSTEMSTDERRMSG']._serialized_start=1184
56
+ _globals['_SYSTEMSTDERRMSG']._serialized_end=1280
57
+ _globals['_SYSTEMREPORTRETURNCODE']._serialized_start=1282
58
+ _globals['_SYSTEMREPORTRETURNCODE']._serialized_end=1326
59
+ _globals['_SYSTEMREPORTRETURNCODEMSG']._serialized_start=1328
60
+ _globals['_SYSTEMREPORTRETURNCODEMSG']._serialized_end=1444
61
+ _globals['_FORMATTING']._serialized_start=1446
62
+ _globals['_FORMATTING']._serialized_end=1471
63
+ _globals['_FORMATTINGMSG']._serialized_start=1473
64
+ _globals['_FORMATTINGMSG']._serialized_end=1565
65
+ _globals['_NOTE']._serialized_start=1567
66
+ _globals['_NOTE']._serialized_end=1586
67
+ _globals['_NOTEMSG']._serialized_start=1588
68
+ _globals['_NOTEMSG']._serialized_end=1668
69
+ _globals['_PRINTEVENT']._serialized_start=1670
70
+ _globals['_PRINTEVENT']._serialized_end=1695
71
+ _globals['_PRINTEVENTMSG']._serialized_start=1697
72
+ _globals['_PRINTEVENTMSG']._serialized_end=1789
68
73
  # @@protoc_insertion_point(module_scope)
dbt_common/record.py CHANGED
@@ -2,8 +2,8 @@
2
2
  external systems during a command invocation, so that the command can be re-run
3
3
  later with the recording 'replayed' to dbt.
4
4
 
5
- If dbt behaves sufficiently deterministically, we will be able to use the
6
- record/replay mechanism in several interesting test and debugging scenarios.
5
+ The rationale for and architecture of this module is described in detail in the
6
+ docs/guides/record_replay.md document in this repository.
7
7
  """
8
8
  import functools
9
9
  import dataclasses
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dbt-common
3
- Version: 1.0.3
3
+ Version: 1.1.0
4
4
  Summary: The shared common utilities that dbt-core and adapter implementations use
5
5
  Project-URL: Homepage, https://github.com/dbt-labs/dbt-common
6
6
  Project-URL: Repository, https://github.com/dbt-labs/dbt-common.git
@@ -30,7 +30,7 @@ Requires-Dist: isodate<0.7,>=0.6
30
30
  Requires-Dist: jinja2<4,>=3.1.3
31
31
  Requires-Dist: jsonschema<5.0,>=4.0
32
32
  Requires-Dist: mashumaro[msgpack]<4.0,>=3.9
33
- Requires-Dist: pathspec<0.12,>=0.9
33
+ Requires-Dist: pathspec<0.13,>=0.9
34
34
  Requires-Dist: protobuf<5.0.0,>=4.0.0
35
35
  Requires-Dist: python-dateutil<3.0,>=2.0
36
36
  Requires-Dist: requests<3.0.0
@@ -55,6 +55,7 @@ Requires-Dist: types-requests; extra == 'lint'
55
55
  Provides-Extra: test
56
56
  Requires-Dist: hypothesis<7.0,>=6.87; extra == 'test'
57
57
  Requires-Dist: pytest-cov<5.0,>=4.1; extra == 'test'
58
+ Requires-Dist: pytest-mock; extra == 'test'
58
59
  Requires-Dist: pytest-xdist<4.0,>=3.2; extra == 'test'
59
60
  Requires-Dist: pytest<8.0,>=7.3; extra == 'test'
60
61
  Description-Content-Type: text/markdown
@@ -1,12 +1,12 @@
1
- dbt_common/__about__.py,sha256=aPZd67JHwKeYQpkPx2xeKQzURWqccZRuS_6cls3V0HA,18
1
+ dbt_common/__about__.py,sha256=s2Ub2ir58wRlYlwo-oIC_0mBAViCnB9La690rWDGBd8,18
2
2
  dbt_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  dbt_common/constants.py,sha256=-Y5DIL1SDPQWtlCNizXRYxFgbx1D7LaLs1ysamvGMRk,278
4
4
  dbt_common/context.py,sha256=BhgT7IgyvpZHEtIdFVVuBBBX5LuU7obXT7NvIPeuD2g,1760
5
- dbt_common/dataclass_schema.py,sha256=R8YBju2Z-qRfy5eJa-jYWedS43rXk9P6E9ttofFc9xU,5282
5
+ dbt_common/dataclass_schema.py,sha256=t3HGD0oXTSjitctuCVHv3iyq5BT3jxoSxv_VGkrJlEo,5523
6
6
  dbt_common/helper_types.py,sha256=NoxqGFAq9bOjh7rqtz_eepXAxk20n3mmW_gUVpnMyYU,3901
7
7
  dbt_common/invocation.py,sha256=Zw8jRPn75oi2VrUD6qGvaCDtSyIfqm5pJlPpRjs3s1E,202
8
8
  dbt_common/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- dbt_common/record.py,sha256=bQ_1fC5qp_RlQxLXq_wHYl5G37BvkzE0d_F2F39PDUA,7015
9
+ dbt_common/record.py,sha256=I2m4P9G44j5xCpRKNaswmPDInexC9A_pODbm0_vVccw,7002
10
10
  dbt_common/semver.py,sha256=2zoZYCQ7PfswqslT2NHuMGgPGMuMuX-yRThVoqfDWQU,13954
11
11
  dbt_common/tests.py,sha256=6lC_JuRtoYO6cbAF8-R5aTM4HtQiM_EH8X5m_97duGY,315
12
12
  dbt_common/ui.py,sha256=rc2TEM29raBFc_LXcg901pMDD07C2ohwp9qzkE-7pBY,2567
@@ -22,22 +22,22 @@ dbt_common/contracts/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
22
22
  dbt_common/contracts/config/base.py,sha256=jWLf6SBUy7wngYs0Z5Zmx1O1v86XRueYaABlZ0W2Bxc,8356
23
23
  dbt_common/contracts/config/materialization.py,sha256=rahC72qZ0-jB8oPwxyPooZXc5NJ-smg74g2HnGOMj34,256
24
24
  dbt_common/contracts/config/metadata.py,sha256=X47-tEA8q2ZfSMcYv0godUwTSVjt8NI77tD4NqdgM0c,1877
25
- dbt_common/contracts/config/properties.py,sha256=K8Ut_q4U6pPY1ZJoFKEA6FUCLR1zb2kFa4Jb4bYb0-0,2194
25
+ dbt_common/contracts/config/properties.py,sha256=gWt6xsP4rVOqRKhmagiUhWnDynzD9mykfMYMTviwpEU,2281
26
26
  dbt_common/events/README.md,sha256=CSwVajoxCAqOug2UCnXldH1EUK7Kjf3rcq7z9ACjrss,3023
27
27
  dbt_common/events/__init__.py,sha256=av08vfpxo0ek7PqZNtMxY8FODJ3xwph4ehRxgInx4LA,383
28
- dbt_common/events/base_types.py,sha256=E--Fl-KMdJd_UZCN93AuLxnJcQoys2MJjiJxkV03HpM,5448
28
+ dbt_common/events/base_types.py,sha256=1l4Yx8zuma7jABB1fcPvL20ltpQ46w0mlYxn48kHykY,5415
29
29
  dbt_common/events/contextvars.py,sha256=Jx2J_Nkx0DH8EE1Sno_mbv7PMLBfCzm7byeFlUeflLA,3079
30
30
  dbt_common/events/event_handler.py,sha256=jfi0PyqIOGnXCG9HEa0VIVULqNvXs1RYmAg0b50ChQs,1385
31
- dbt_common/events/event_manager.py,sha256=ZXJ-N4NsfQTnkEpvuedTjHD8Gt8DgYHbz601eTVCm-o,2175
32
- dbt_common/events/event_manager_client.py,sha256=etDlUv-3iIwM5IXXuzc1cmQID2fHOXw8dE9snp39-jk,1014
31
+ dbt_common/events/event_manager.py,sha256=IIUwSyt_RcBbUI_iE5mnpmZt2uW7lG49RXOWz2VlUv0,2300
32
+ dbt_common/events/event_manager_client.py,sha256=VKlIYJPcexmDKnidkyrs8BIuNZ1_CwDFGz-gBM2SAvo,1193
33
33
  dbt_common/events/format.py,sha256=x1RWDZ8G7ZMHmxdld6Q4VXca4kvnhiQOIaQXkC6Uo0Q,1609
34
34
  dbt_common/events/functions.py,sha256=K-R-FBTeO03U51gtMBu1EUcNsIAsgw_e5spWxLJ44VE,4762
35
35
  dbt_common/events/helpers.py,sha256=CfsWwNDjsLJkPIgOtAfuLEnZ3rGUKeYsH8aDtCW12OA,410
36
36
  dbt_common/events/interfaces.py,sha256=hEDeDoB0FW2RYHVZBG7gebEt_mUVBzkn1yPubpaxs-s,147
37
- dbt_common/events/logger.py,sha256=6LLH8aLoRziFLBmwu-TCR5-EMpBtD28pSaL0FmKpeGA,6159
38
- dbt_common/events/types.proto,sha256=SujcfPOPAfyHzeRXkn9_uKEDeQ-andSW1pI6fpWpQdo,1885
39
- dbt_common/events/types.py,sha256=Bq-EvKQ8IPcRLwf_ukjfqjpYvakOcg4RzOL2zbPttbM,3538
40
- dbt_common/events/types_pb2.py,sha256=5DHt8X_ejqOuRiP-GrnVw8wDFUOTfBRlZQ2In1L1LOw,5569
37
+ dbt_common/events/logger.py,sha256=mAUNLZlIIOl3T2u7KOe8FF_deTNNe1CRJqmkPw4YH1U,6728
38
+ dbt_common/events/types.proto,sha256=nsOE3XFYBPovT9Th8WMkDWxBXa-adqiL23zCYfOdVk0,2013
39
+ dbt_common/events/types.py,sha256=quE22Kp78J51_8f1Si_K-xg0gA2Sg-fw9XDjNrcy81M,3905
40
+ dbt_common/events/types_pb2.py,sha256=Gn3exMla0FjoA-5OQTjOeKCT_DLxzvcA3YHPfbFjAck,6563
41
41
  dbt_common/exceptions/__init__.py,sha256=X_Uw7BxOzXev_9JMYfs5Cm-_i_Qf2PJim8_-dDJI7Y8,361
42
42
  dbt_common/exceptions/base.py,sha256=uuI_2y_BQrjCyjHKR2pWeCica1dyoo1cc4e1Tq0de7M,7583
43
43
  dbt_common/exceptions/cache.py,sha256=0z4fBcdNZMAR41YbPRo2GN0__xAMaYs8Uc-t3hjmVio,2532
@@ -55,7 +55,7 @@ dbt_common/utils/encoding.py,sha256=6_kSY2FvGNYMg7oX7PrbvVioieydih3Kl7Ii802LaHI,
55
55
  dbt_common/utils/executor.py,sha256=Zyzd1wML3aN-iYn9ZG2Gc_jj5vknmvQNyH-c0RaPIpo,2446
56
56
  dbt_common/utils/formatting.py,sha256=JUn5rzJ-uajs9wPCN0-f2iRFY1pOJF5YjTD9dERuLoc,165
57
57
  dbt_common/utils/jinja.py,sha256=XNfZHuZhLM_R_yPmzYojPm6bF7QOoxIjSWrkJRw6wks,965
58
- dbt_common-1.0.3.dist-info/METADATA,sha256=r4iBhwgYu3fgWbkarknw_Gd9KxBXSSdhFCSGTnZvJHM,5220
59
- dbt_common-1.0.3.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
60
- dbt_common-1.0.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
61
- dbt_common-1.0.3.dist-info/RECORD,,
58
+ dbt_common-1.1.0.dist-info/METADATA,sha256=izwa7aTllaTAXte2khGMV01L_8rQu5B28NiFPS1wsuU,5264
59
+ dbt_common-1.1.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
60
+ dbt_common-1.1.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
61
+ dbt_common-1.1.0.dist-info/RECORD,,