dbt-common 1.23.0__py3-none-any.whl → 2.0.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 +1 -1
- dbt_common/events/README.md +1 -8
- dbt_common/events/base_types.py +6 -8
- dbt_common/events/event_manager.py +15 -9
- dbt_common/events/functions.py +4 -2
- dbt_common/events/types_pb2.py +2 -91
- dbt_common/helper_types.py +124 -67
- dbt_common/ui.py +13 -7
- {dbt_common-1.23.0.dist-info → dbt_common-2.0.0.dist-info}/METADATA +2 -1
- {dbt_common-1.23.0.dist-info → dbt_common-2.0.0.dist-info}/RECORD +12 -13
- dbt_common/events/types.proto +0 -156
- {dbt_common-1.23.0.dist-info → dbt_common-2.0.0.dist-info}/WHEEL +0 -0
- {dbt_common-1.23.0.dist-info → dbt_common-2.0.0.dist-info}/licenses/LICENSE +0 -0
dbt_common/__about__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
version = "
|
1
|
+
version = "2.0.0"
|
dbt_common/events/README.md
CHANGED
@@ -8,14 +8,7 @@ The event module provides types that represent what is happening in dbt in `even
|
|
8
8
|
When events are processed via `fire_event`, nearly everything is logged. Whether or not the user has enabled the debug flag, all debug messages are still logged to the file. However, some events are particularly time consuming to construct because they return a huge amount of data. Today, the only messages in this category are cache events and are only logged if the `--log-cache-events` flag is on. This is important because these messages should not be created unless they are going to be logged, because they cause a noticable performance degredation. These events use a "fire_event_if" functions.
|
9
9
|
|
10
10
|
# Adding a New Event
|
11
|
-
|
12
|
-
* run the protoc compiler to update types_pb2.py: make proto_types
|
13
|
-
* Add a wrapping class in dbt_common/event/types.py with a Level superclass plus code and message methods
|
14
|
-
* Add the class to tests/unit/test_events.py
|
15
|
-
|
16
|
-
We have switched from using betterproto to using google protobuf, because of a lack of support for Struct fields in betterproto.
|
17
|
-
|
18
|
-
The google protobuf interface is janky and very much non-Pythonic. The "generated" classes in types_pb2.py do not resemble regular Python classes. They do not have normal constructors; they can only be constructed empty. They can be "filled" by setting fields individually or using a json_format method like ParseDict. We have wrapped the logging events with a class (in types.py) which allows using a constructor -- keywords only, no positional parameters.
|
11
|
+
All protos have been moved into the central protos repository. To edit an event proto, edit https://github.com/dbt-labs/proto-python-public or open an issue on that repository.
|
19
12
|
|
20
13
|
## Required for Every Event
|
21
14
|
|
dbt_common/events/base_types.py
CHANGED
@@ -1,17 +1,15 @@
|
|
1
|
-
from enum import Enum
|
2
1
|
import os
|
3
2
|
import threading
|
3
|
+
from enum import Enum
|
4
|
+
from typing import Callable, Optional, Protocol
|
5
|
+
|
4
6
|
from dbt_common.events import types_pb2
|
5
|
-
from google.protobuf.json_format import
|
7
|
+
from google.protobuf.json_format import MessageToDict, MessageToJson, ParseDict
|
6
8
|
from google.protobuf.message import Message
|
7
|
-
from dbt_common.events.helpers import get_json_string_utcnow
|
8
|
-
from typing import Callable, Optional
|
9
9
|
|
10
|
+
from dbt_common.events.helpers import get_json_string_utcnow
|
10
11
|
from dbt_common.invocation import get_invocation_id
|
11
12
|
|
12
|
-
from typing import Protocol
|
13
|
-
|
14
|
-
|
15
13
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
16
14
|
# These base types define the _required structure_ for the concrete event #
|
17
15
|
# types defined in types.py #
|
@@ -66,8 +64,8 @@ class BaseEvent:
|
|
66
64
|
self.pb_msg = ParseDict(kwargs, msg_cls())
|
67
65
|
except Exception as exc:
|
68
66
|
# Imports need to be here to avoid circular imports
|
69
|
-
from dbt_common.events.types import Note
|
70
67
|
from dbt_common.events.functions import fire_event
|
68
|
+
from dbt_common.events.types import Note
|
71
69
|
|
72
70
|
error_msg = f"[{class_name}]: Unable to parse logging event dictionary. {exc}. Dictionary: {kwargs}"
|
73
71
|
# If we're testing throw an error so that we notice failures
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import os
|
2
2
|
import traceback
|
3
|
-
from typing import Any, List, Optional, Protocol, Tuple
|
3
|
+
from typing import Any, List, Optional, Protocol, Tuple, Union
|
4
4
|
|
5
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
|
from dbt_common.exceptions.events import EventCompilationError
|
8
|
-
from dbt_common.helper_types import WarnErrorOptions
|
8
|
+
from dbt_common.helper_types import WarnErrorOptions, WarnErrorOptionsV2
|
9
9
|
|
10
10
|
|
11
11
|
class EventManager:
|
@@ -13,7 +13,7 @@ class EventManager:
|
|
13
13
|
self.loggers: List[_Logger] = []
|
14
14
|
self.callbacks: List[TCallback] = []
|
15
15
|
self._warn_error: Optional[bool] = None
|
16
|
-
self._warn_error_options: Optional[WarnErrorOptions] = None
|
16
|
+
self._warn_error_options: Optional[Union[WarnErrorOptions, WarnErrorOptionsV2]] = None
|
17
17
|
self.require_warn_or_error_handling: bool = False
|
18
18
|
|
19
19
|
@property
|
@@ -29,15 +29,21 @@ class EventManager:
|
|
29
29
|
self._warn_error = warn_error
|
30
30
|
|
31
31
|
@property
|
32
|
-
def warn_error_options(self) -> WarnErrorOptions:
|
32
|
+
def warn_error_options(self) -> Union[WarnErrorOptions, WarnErrorOptionsV2]:
|
33
|
+
# Technically this always returns a WarnErrorOptionsV2, but to remain backwards compatible
|
34
|
+
# with the protocol, we need to type the function as being able to return either.
|
35
|
+
|
33
36
|
if self._warn_error_options is None:
|
34
37
|
from dbt_common.events.functions import WARN_ERROR_OPTIONS
|
35
38
|
|
36
|
-
return WARN_ERROR_OPTIONS
|
37
|
-
|
39
|
+
return WARN_ERROR_OPTIONS._warn_error_options_v2
|
40
|
+
|
41
|
+
return self._warn_error_options._warn_error_options_v2
|
38
42
|
|
39
43
|
@warn_error_options.setter
|
40
|
-
def warn_error_options(
|
44
|
+
def warn_error_options(
|
45
|
+
self, warn_error_options: Union[WarnErrorOptions, WarnErrorOptionsV2]
|
46
|
+
) -> None:
|
41
47
|
self._warn_error_options = warn_error_options
|
42
48
|
|
43
49
|
def fire_event(
|
@@ -52,7 +58,7 @@ class EventManager:
|
|
52
58
|
if force_warn_or_error_handling or (
|
53
59
|
self.require_warn_or_error_handling and msg.info.level == "warn"
|
54
60
|
):
|
55
|
-
if self.warn_error or self.warn_error_options.
|
61
|
+
if self.warn_error or self.warn_error_options.errors(e):
|
56
62
|
# This has the potential to create an infinite loop if the handling of the raised
|
57
63
|
# EventCompilationError fires an event as a warning instead of an error.
|
58
64
|
raise EventCompilationError(e.message(), node)
|
@@ -95,7 +101,7 @@ class IEventManager(Protocol):
|
|
95
101
|
callbacks: List[TCallback]
|
96
102
|
loggers: List[_Logger]
|
97
103
|
warn_error: bool
|
98
|
-
warn_error_options: WarnErrorOptions
|
104
|
+
warn_error_options: Union[WarnErrorOptions, WarnErrorOptionsV2]
|
99
105
|
require_warn_or_error_handling: bool
|
100
106
|
|
101
107
|
def fire_event(
|
dbt_common/events/functions.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
from pathlib import Path
|
2
2
|
|
3
3
|
from dbt_common.events.event_manager_client import get_event_manager
|
4
|
-
from dbt_common.helper_types import WarnErrorOptions
|
4
|
+
from dbt_common.helper_types import WarnErrorOptions, WarnErrorOptionsV2
|
5
5
|
from dbt_common.invocation import get_invocation_id
|
6
6
|
from dbt_common.utils.encoding import ForgivingJSONEncoder
|
7
7
|
from dbt_common.events.base_types import BaseEvent, EventLevel, EventMsg
|
@@ -18,7 +18,9 @@ from google.protobuf.json_format import MessageToDict
|
|
18
18
|
LOG_VERSION = 3
|
19
19
|
metadata_vars: Optional[Dict[str, str]] = None
|
20
20
|
_METADATA_ENV_PREFIX = "DBT_ENV_CUSTOM_ENV_"
|
21
|
-
WARN_ERROR_OPTIONS = WarnErrorOptions(
|
21
|
+
WARN_ERROR_OPTIONS: Union[WarnErrorOptions, WarnErrorOptionsV2] = WarnErrorOptions(
|
22
|
+
include=[], exclude=[]
|
23
|
+
)
|
22
24
|
WARN_ERROR = False
|
23
25
|
|
24
26
|
# This global, and the following two functions for capturing stdout logs are
|
dbt_common/events/types_pb2.py
CHANGED
@@ -1,91 +1,2 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
# NO CHECKED-IN PROTOBUF GENCODE
|
4
|
-
# source: types.proto
|
5
|
-
# Protobuf Python Version: 5.28.3
|
6
|
-
"""Generated protocol buffer code."""
|
7
|
-
from google.protobuf import descriptor as _descriptor
|
8
|
-
from google.protobuf import descriptor_pool as _descriptor_pool
|
9
|
-
from google.protobuf import runtime_version as _runtime_version
|
10
|
-
from google.protobuf import symbol_database as _symbol_database
|
11
|
-
from google.protobuf.internal import builder as _builder
|
12
|
-
_runtime_version.ValidateProtobufRuntimeVersion(
|
13
|
-
_runtime_version.Domain.PUBLIC,
|
14
|
-
5,
|
15
|
-
28,
|
16
|
-
3,
|
17
|
-
'',
|
18
|
-
'types.proto'
|
19
|
-
)
|
20
|
-
# @@protoc_insertion_point(imports)
|
21
|
-
|
22
|
-
_sym_db = _symbol_database.Default()
|
23
|
-
|
24
|
-
|
25
|
-
from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2
|
26
|
-
|
27
|
-
|
28
|
-
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\"d\n\x13\x42\x65haviorChangeEvent\x12\x11\n\tflag_name\x18\x01 \x01(\t\x12\x13\n\x0b\x66lag_source\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x10\n\x08\x64ocs_url\x18\x04 \x01(\t\"n\n\x16\x42\x65haviorChangeEventMsg\x12$\n\x04info\x18\x01 \x01(\x0b\x32\x16.proto_types.EventInfo\x12.\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32 .proto_types.BehaviorChangeEvent\"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.PrintEvent\" \n\x11RecordReplayIssue\x12\x0b\n\x03msg\x18\x01 \x01(\t\"j\n\x14RecordReplayIssueMsg\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.RecordReplayIssueb\x06proto3')
|
29
|
-
|
30
|
-
_globals = globals()
|
31
|
-
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
32
|
-
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'types_pb2', _globals)
|
33
|
-
if not _descriptor._USE_C_DESCRIPTORS:
|
34
|
-
DESCRIPTOR._loaded_options = None
|
35
|
-
_globals['_EVENTINFO_EXTRAENTRY']._loaded_options = None
|
36
|
-
_globals['_EVENTINFO_EXTRAENTRY']._serialized_options = b'8\001'
|
37
|
-
_globals['_EVENTINFO']._serialized_start=62
|
38
|
-
_globals['_EVENTINFO']._serialized_end=335
|
39
|
-
_globals['_EVENTINFO_EXTRAENTRY']._serialized_start=291
|
40
|
-
_globals['_EVENTINFO_EXTRAENTRY']._serialized_end=335
|
41
|
-
_globals['_GENERICMESSAGE']._serialized_start=337
|
42
|
-
_globals['_GENERICMESSAGE']._serialized_end=391
|
43
|
-
_globals['_BEHAVIORCHANGEEVENT']._serialized_start=393
|
44
|
-
_globals['_BEHAVIORCHANGEEVENT']._serialized_end=493
|
45
|
-
_globals['_BEHAVIORCHANGEEVENTMSG']._serialized_start=495
|
46
|
-
_globals['_BEHAVIORCHANGEEVENTMSG']._serialized_end=605
|
47
|
-
_globals['_RETRYEXTERNALCALL']._serialized_start=607
|
48
|
-
_globals['_RETRYEXTERNALCALL']._serialized_end=656
|
49
|
-
_globals['_RETRYEXTERNALCALLMSG']._serialized_start=658
|
50
|
-
_globals['_RETRYEXTERNALCALLMSG']._serialized_end=764
|
51
|
-
_globals['_RECORDRETRYEXCEPTION']._serialized_start=766
|
52
|
-
_globals['_RECORDRETRYEXCEPTION']._serialized_end=801
|
53
|
-
_globals['_RECORDRETRYEXCEPTIONMSG']._serialized_start=803
|
54
|
-
_globals['_RECORDRETRYEXCEPTIONMSG']._serialized_end=915
|
55
|
-
_globals['_SYSTEMCOULDNOTWRITE']._serialized_start=917
|
56
|
-
_globals['_SYSTEMCOULDNOTWRITE']._serialized_end=981
|
57
|
-
_globals['_SYSTEMCOULDNOTWRITEMSG']._serialized_start=983
|
58
|
-
_globals['_SYSTEMCOULDNOTWRITEMSG']._serialized_end=1093
|
59
|
-
_globals['_SYSTEMEXECUTINGCMD']._serialized_start=1095
|
60
|
-
_globals['_SYSTEMEXECUTINGCMD']._serialized_end=1128
|
61
|
-
_globals['_SYSTEMEXECUTINGCMDMSG']._serialized_start=1130
|
62
|
-
_globals['_SYSTEMEXECUTINGCMDMSG']._serialized_end=1238
|
63
|
-
_globals['_SYSTEMSTDOUT']._serialized_start=1240
|
64
|
-
_globals['_SYSTEMSTDOUT']._serialized_end=1268
|
65
|
-
_globals['_SYSTEMSTDOUTMSG']._serialized_start=1270
|
66
|
-
_globals['_SYSTEMSTDOUTMSG']._serialized_end=1366
|
67
|
-
_globals['_SYSTEMSTDERR']._serialized_start=1368
|
68
|
-
_globals['_SYSTEMSTDERR']._serialized_end=1396
|
69
|
-
_globals['_SYSTEMSTDERRMSG']._serialized_start=1398
|
70
|
-
_globals['_SYSTEMSTDERRMSG']._serialized_end=1494
|
71
|
-
_globals['_SYSTEMREPORTRETURNCODE']._serialized_start=1496
|
72
|
-
_globals['_SYSTEMREPORTRETURNCODE']._serialized_end=1540
|
73
|
-
_globals['_SYSTEMREPORTRETURNCODEMSG']._serialized_start=1542
|
74
|
-
_globals['_SYSTEMREPORTRETURNCODEMSG']._serialized_end=1658
|
75
|
-
_globals['_FORMATTING']._serialized_start=1660
|
76
|
-
_globals['_FORMATTING']._serialized_end=1685
|
77
|
-
_globals['_FORMATTINGMSG']._serialized_start=1687
|
78
|
-
_globals['_FORMATTINGMSG']._serialized_end=1779
|
79
|
-
_globals['_NOTE']._serialized_start=1781
|
80
|
-
_globals['_NOTE']._serialized_end=1800
|
81
|
-
_globals['_NOTEMSG']._serialized_start=1802
|
82
|
-
_globals['_NOTEMSG']._serialized_end=1882
|
83
|
-
_globals['_PRINTEVENT']._serialized_start=1884
|
84
|
-
_globals['_PRINTEVENT']._serialized_end=1909
|
85
|
-
_globals['_PRINTEVENTMSG']._serialized_start=1911
|
86
|
-
_globals['_PRINTEVENTMSG']._serialized_end=2003
|
87
|
-
_globals['_RECORDREPLAYISSUE']._serialized_start=2005
|
88
|
-
_globals['_RECORDREPLAYISSUE']._serialized_end=2037
|
89
|
-
_globals['_RECORDREPLAYISSUEMSG']._serialized_start=2039
|
90
|
-
_globals['_RECORDREPLAYISSUEMSG']._serialized_end=2145
|
91
|
-
# @@protoc_insertion_point(module_scope)
|
1
|
+
# preserving import path during dbtlabs.proto refactor
|
2
|
+
from dbtlabs.proto.public.v1.fields.common_types_pb2 import * # noqa
|
dbt_common/helper_types.py
CHANGED
@@ -65,109 +65,169 @@ class IncludeExclude(dbtClassMixin):
|
|
65
65
|
|
66
66
|
|
67
67
|
class WarnErrorOptions(IncludeExclude):
|
68
|
+
"""Deprecated, use WarnErrorOptionsV2 instead."""
|
69
|
+
|
70
|
+
DEPRECATIONS = "Deprecations"
|
71
|
+
|
72
|
+
def __init__(
|
73
|
+
self,
|
74
|
+
include: Union[str, List[str]],
|
75
|
+
exclude: Optional[List[str]] = None,
|
76
|
+
valid_error_names: Optional[Set[str]] = None,
|
77
|
+
silence: Optional[List[str]] = None,
|
78
|
+
):
|
79
|
+
self.silence = silence or []
|
80
|
+
self._valid_error_names: Set[str] = valid_error_names or set()
|
81
|
+
self._valid_error_names.add(self.DEPRECATIONS)
|
82
|
+
super().__init__(include=include, exclude=(exclude or []))
|
83
|
+
|
84
|
+
self._warn_error_options_v2 = WarnErrorOptionsV2(
|
85
|
+
error=self.include,
|
86
|
+
warn=self.exclude,
|
87
|
+
silence=self.silence,
|
88
|
+
valid_error_names=self._valid_error_names,
|
89
|
+
)
|
90
|
+
|
91
|
+
def __post_init__(self):
|
92
|
+
# We don't want IncludeExclude's post_init to run, so we override it.
|
93
|
+
# We are fine with just having the WarnErrorOptionsV2's post_init run on instantiation.
|
94
|
+
pass
|
95
|
+
|
96
|
+
def includes(self, item_name: Union[str, BaseEvent]) -> bool:
|
97
|
+
return self._warn_error_options_v2.includes(item_name)
|
98
|
+
|
99
|
+
def errors(self, item_name: Union[str, BaseEvent]) -> bool:
|
100
|
+
"""Exists for forward compatibility with WarnErrorOptionsV2."""
|
101
|
+
return self._warn_error_options_v2.errors(item_name)
|
102
|
+
|
103
|
+
def silenced(self, item_name: Union[str, BaseEvent]) -> bool:
|
104
|
+
return self._warn_error_options_v2.silenced(item_name)
|
105
|
+
|
106
|
+
|
107
|
+
@dataclass
|
108
|
+
class WarnErrorOptionsV2(dbtClassMixin):
|
68
109
|
"""
|
69
110
|
This class is used to configure the behavior of the warn_error feature (now part of fire_event).
|
70
111
|
|
71
|
-
|
72
|
-
|
112
|
+
error: "all", "*", or a list of event names.
|
113
|
+
warn: a list of event names.
|
73
114
|
silence: a list of event names.
|
74
|
-
valid_error_names: a set of event names that can be named in
|
115
|
+
valid_error_names: a set of event names that can be named in error, warn, and silence.
|
75
116
|
|
76
117
|
In a hierarchy of configuration, the following rules apply:
|
77
118
|
1. named > Deprecations > "all"/"*"
|
78
|
-
2. silence >
|
119
|
+
2. silence > warn > error
|
79
120
|
3. (1) > (2)
|
80
121
|
"""
|
81
122
|
|
123
|
+
ERROR_ALL = ("all", "*")
|
82
124
|
DEPRECATIONS = "Deprecations"
|
83
125
|
|
126
|
+
error: Union[str, List[str]]
|
127
|
+
warn: List[str]
|
128
|
+
silence: List[str]
|
129
|
+
|
84
130
|
def __init__(
|
85
131
|
self,
|
86
|
-
|
87
|
-
|
88
|
-
valid_error_names: Optional[Set[str]] = None,
|
132
|
+
error: Optional[Union[str, List[str]]] = None,
|
133
|
+
warn: Optional[List[str]] = None,
|
89
134
|
silence: Optional[List[str]] = None,
|
135
|
+
valid_error_names: Optional[Set[str]] = None,
|
90
136
|
):
|
91
|
-
self.silence = silence or []
|
92
137
|
self._valid_error_names: Set[str] = valid_error_names or set()
|
93
138
|
self._valid_error_names.add(self.DEPRECATIONS)
|
94
|
-
super().__init__(include=include, exclude=(exclude or []))
|
95
139
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
140
|
+
# We can't do `= error or []` because if someone passes in an empty list, and latter appends to that list
|
141
|
+
# they would expect references to the original list to be updated.
|
142
|
+
self.error = error if error is not None else []
|
143
|
+
self.warn = warn if warn is not None else []
|
144
|
+
self.silence = silence if silence is not None else []
|
101
145
|
|
102
|
-
#
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
146
|
+
# since we're overriding the dataclass auto __init__, we need to call __post_init__ manually
|
147
|
+
self.__post_init__()
|
148
|
+
|
149
|
+
def __post_init__(self):
|
150
|
+
if isinstance(self.error, str) and self.error not in self.ERROR_ALL:
|
151
|
+
raise ValidationError(f"error must be one of {self.ERROR_ALL} or a list of strings")
|
152
|
+
|
153
|
+
# To specify `warn`, one of the following must be true
|
154
|
+
# 1. `error` must be "all"/"*"
|
155
|
+
# 2. "deprecations" must be in either `error` or `silence`.
|
156
|
+
if self.warn and not (
|
157
|
+
self.error in self.ERROR_ALL
|
158
|
+
or self.DEPRECATIONS in self.error
|
107
159
|
or self.DEPRECATIONS in self.silence
|
108
160
|
):
|
109
161
|
raise ValidationError(
|
110
|
-
f"
|
111
|
-
f"{self.DEPRECATIONS} is in
|
162
|
+
f"`warn` can only be specified if `error` is one of {self.ERROR_ALL} or "
|
163
|
+
f"{self.DEPRECATIONS} is in `error` or silence."
|
112
164
|
)
|
113
165
|
|
114
|
-
if isinstance(self.
|
115
|
-
self._validate_items(self.
|
166
|
+
if isinstance(self.error, list):
|
167
|
+
self._validate_items(self.error)
|
116
168
|
|
117
|
-
if isinstance(self.
|
118
|
-
self._validate_items(self.
|
169
|
+
if isinstance(self.warn, list):
|
170
|
+
self._validate_items(self.warn)
|
119
171
|
|
120
172
|
if isinstance(self.silence, list):
|
121
173
|
self._validate_items(self.silence)
|
122
174
|
|
123
|
-
def
|
124
|
-
|
125
|
-
|
175
|
+
def _validate_items(self, items: List[str]):
|
176
|
+
for item in items:
|
177
|
+
if item not in self._valid_error_names:
|
178
|
+
raise ValidationError(f"{item} is not a valid dbt error name.")
|
179
|
+
|
180
|
+
@property
|
181
|
+
def _warn_error_options_v2(self) -> WarnErrorOptionsV2:
|
182
|
+
# This is necessary because in core we directly set the WARN_ERROR_OPTIONS global variable
|
183
|
+
# without this we'd need to do isinstance checks in `EventManager.warn_error_options`, which
|
184
|
+
# would be costly as it gets called every time an event is fired.
|
185
|
+
return self
|
186
|
+
|
187
|
+
def _error_all(self) -> bool:
|
188
|
+
"""Is `*` or `all` set as error?"""
|
189
|
+
return self.error in self.ERROR_ALL
|
126
190
|
|
127
|
-
def
|
128
|
-
"""Is the item_name named in the
|
129
|
-
return item_name in self.
|
191
|
+
def _named_error(self, item_name: str) -> bool:
|
192
|
+
"""Is the item_name named in the error list?"""
|
193
|
+
return item_name in self.error
|
130
194
|
|
131
|
-
def
|
132
|
-
"""Is the item_name named in the
|
133
|
-
return item_name in self.
|
195
|
+
def _named_warn(self, item_name: str) -> bool:
|
196
|
+
"""Is the item_name named in the warn list?"""
|
197
|
+
return item_name in self.warn
|
134
198
|
|
135
199
|
def _named_silence(self, item_name: str) -> bool:
|
136
200
|
"""Is the item_name named in the silence list?"""
|
137
201
|
return item_name in self.silence
|
138
202
|
|
139
|
-
def
|
140
|
-
"""Is event
|
203
|
+
def _error_as_deprecation(self, event: Optional[BaseEvent]) -> bool:
|
204
|
+
"""Is the event a deprecation, and if so should it be treated as an error?"""
|
141
205
|
return (
|
142
|
-
event is not None
|
143
|
-
and event.code().startswith("D")
|
144
|
-
and self.DEPRECATIONS in self.include
|
206
|
+
event is not None and event.code().startswith("D") and self.DEPRECATIONS in self.error
|
145
207
|
)
|
146
208
|
|
147
|
-
def
|
148
|
-
"""Is event
|
209
|
+
def _warn_as_deprecation(self, event: Optional[BaseEvent]) -> bool:
|
210
|
+
"""Is the event a deprecation, and if so should it be treated as an warning?"""
|
149
211
|
return (
|
150
|
-
event is not None
|
151
|
-
and event.code().startswith("D")
|
152
|
-
and self.DEPRECATIONS in self.exclude
|
212
|
+
event is not None and event.code().startswith("D") and self.DEPRECATIONS in self.warn
|
153
213
|
)
|
154
214
|
|
155
215
|
def _silence_as_deprecation(self, event: Optional[BaseEvent]) -> bool:
|
156
|
-
"""Is event
|
216
|
+
"""Is the event a deprecation, and if so should it be silenced?"""
|
157
217
|
return (
|
158
218
|
event is not None
|
159
219
|
and event.code().startswith("D")
|
160
220
|
and self.DEPRECATIONS in self.silence
|
161
221
|
)
|
162
222
|
|
163
|
-
def
|
164
|
-
"""
|
223
|
+
def errors(self, item_name: Union[str, BaseEvent]) -> bool:
|
224
|
+
"""Should the event be treated as an error?
|
165
225
|
|
166
|
-
An event
|
167
|
-
- The event is named in `
|
168
|
-
- "*" or "all" is specified for `
|
169
|
-
- The event is a deprecation, "deprecations" is in `
|
170
|
-
nor is "deprecations" in `
|
226
|
+
An event should error if any of the following are true:
|
227
|
+
- The event is named in `error` and not named in `warn` or `silence`
|
228
|
+
- "*" or "all" is specified for `error`, and the event is not named in `warn` or `silence`
|
229
|
+
- The event is a deprecation, "deprecations" is in `error`, and the event is not named in `warn` or `silence`
|
230
|
+
nor is "deprecations" in `warn` or `silence`
|
171
231
|
"""
|
172
232
|
# Setup based on item_name type
|
173
233
|
if isinstance(item_name, str):
|
@@ -178,29 +238,31 @@ class WarnErrorOptions(IncludeExclude):
|
|
178
238
|
event = item_name
|
179
239
|
|
180
240
|
# Pre-compute checks that will be used multiple times
|
181
|
-
named_elsewhere = self.
|
182
|
-
deprecation_elsewhere = self.
|
241
|
+
named_elsewhere = self._named_warn(event_name) or self._named_silence(event_name)
|
242
|
+
deprecation_elsewhere = self._warn_as_deprecation(event) or self._silence_as_deprecation(
|
183
243
|
event
|
184
|
-
)
|
244
|
+
)
|
185
245
|
|
186
246
|
# Calculate result
|
187
|
-
if self.
|
247
|
+
if self._named_error(event_name) and not named_elsewhere:
|
188
248
|
return True
|
189
|
-
elif self.
|
190
|
-
named_elsewhere or deprecation_elsewhere
|
191
|
-
):
|
249
|
+
elif self._error_as_deprecation(event) and not (named_elsewhere or deprecation_elsewhere):
|
192
250
|
return True
|
193
|
-
elif self.
|
251
|
+
elif self._error_all() and not (named_elsewhere or deprecation_elsewhere):
|
194
252
|
return True
|
195
253
|
else:
|
196
254
|
return False
|
197
255
|
|
256
|
+
def includes(self, item_name: Union[str, BaseEvent]) -> bool:
|
257
|
+
"""Deprecated, use `errors` instead."""
|
258
|
+
return self.errors(item_name)
|
259
|
+
|
198
260
|
def silenced(self, item_name: Union[str, BaseEvent]) -> bool:
|
199
261
|
"""Is the event silenced?
|
200
262
|
|
201
263
|
An event silenced if any of the following are true:
|
202
264
|
- The event is named in `silence`
|
203
|
-
- "Deprecations" is in `silence` and the event is not named in `
|
265
|
+
- "Deprecations" is in `silence` and the event is not named in `error` or `warn`
|
204
266
|
"""
|
205
267
|
# Setup based on item_name type
|
206
268
|
if isinstance(item_name, str):
|
@@ -211,7 +273,7 @@ class WarnErrorOptions(IncludeExclude):
|
|
211
273
|
event = item_name
|
212
274
|
|
213
275
|
# Pre-compute checks that will be used multiple times
|
214
|
-
named_elsewhere = self.
|
276
|
+
named_elsewhere = self._named_error(event_name) or self._named_warn(event_name)
|
215
277
|
|
216
278
|
# Calculate result
|
217
279
|
if self._named_silence(event_name):
|
@@ -221,11 +283,6 @@ class WarnErrorOptions(IncludeExclude):
|
|
221
283
|
else:
|
222
284
|
return False
|
223
285
|
|
224
|
-
def _validate_items(self, items: List[str]):
|
225
|
-
for item in items:
|
226
|
-
if item not in self._valid_error_names:
|
227
|
-
raise ValidationError(f"{item} is not a valid dbt error name.")
|
228
|
-
|
229
286
|
|
230
287
|
FQNPath = Tuple[str, ...]
|
231
288
|
PathSet = AbstractSet[FQNPath]
|
dbt_common/ui.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
from os import getenv as os_getenv
|
2
2
|
import sys
|
3
3
|
import textwrap
|
4
|
-
from typing import Dict
|
4
|
+
from typing import Dict, Optional
|
5
5
|
|
6
6
|
import colorama
|
7
7
|
|
@@ -78,13 +78,19 @@ def line_wrap_message(msg: str, subtract: int = 0, dedent: bool = True, prefix:
|
|
78
78
|
return "\n".join(textwrap.fill(chunk, width=width, break_on_hyphens=False) for chunk in chunks)
|
79
79
|
|
80
80
|
|
81
|
-
def warning_tag(msg: str) -> str:
|
82
|
-
|
81
|
+
def warning_tag(msg: str, event_name: Optional[str] = None) -> str:
|
82
|
+
tag = f'[{yellow("WARNING")}]'
|
83
|
+
if event_name:
|
84
|
+
tag += f"[{event_name}]"
|
85
|
+
return f"{tag}: {msg}"
|
83
86
|
|
84
87
|
|
85
|
-
def deprecation_tag(msg: str) -> str:
|
86
|
-
return warning_tag(f"Deprecated functionality\n\n{msg}")
|
88
|
+
def deprecation_tag(msg: str, event_name: Optional[str] = None) -> str:
|
89
|
+
return warning_tag(f"Deprecated functionality\n\n{msg}", event_name)
|
87
90
|
|
88
91
|
|
89
|
-
def error_tag(msg: str) -> str:
|
90
|
-
|
92
|
+
def error_tag(msg: str, event_name: Optional[str] = None) -> str:
|
93
|
+
tag = f'[{red("ERROR")}]'
|
94
|
+
if event_name:
|
95
|
+
tag += f"[{event_name}]"
|
96
|
+
return f"{tag}: {msg}"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: dbt-common
|
3
|
-
Version:
|
3
|
+
Version: 2.0.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
|
@@ -26,6 +26,7 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
26
26
|
Requires-Python: >=3.9
|
27
27
|
Requires-Dist: agate<1.10,>=1.7.0
|
28
28
|
Requires-Dist: colorama<0.5,>=0.3.9
|
29
|
+
Requires-Dist: dbt-protos<2.0.0,>=1.0.291
|
29
30
|
Requires-Dist: deepdiff<8.0,>=7.0
|
30
31
|
Requires-Dist: isodate<0.7,>=0.6
|
31
32
|
Requires-Dist: jinja2<4,>=3.1.3
|
@@ -1,16 +1,16 @@
|
|
1
|
-
dbt_common/__about__.py,sha256=
|
1
|
+
dbt_common/__about__.py,sha256=5ZOF-5IV4pxLAC7yWK2kh4cvLYgnT2AwvRq2FGzBL94,18
|
2
2
|
dbt_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
dbt_common/behavior_flags.py,sha256=hQzxCqQSweJbRp_xoQqNnlUF77PBuOdCdLOSdcBlkxk,4885
|
4
4
|
dbt_common/constants.py,sha256=-Y5DIL1SDPQWtlCNizXRYxFgbx1D7LaLs1ysamvGMRk,278
|
5
5
|
dbt_common/context.py,sha256=-ErtKG4xfOh1-Y569fwu6u2O381nRan18HhATrYDoZE,2950
|
6
6
|
dbt_common/dataclass_schema.py,sha256=u2S0dxwxIghv8RMqC91HlWZJVxmsC_844yZQaGyOwdY,5563
|
7
|
-
dbt_common/helper_types.py,sha256=
|
7
|
+
dbt_common/helper_types.py,sha256=wxbbjfsvHVraWexK88PEY3q_dAYqlPl6yOIXnpxCcyY,11569
|
8
8
|
dbt_common/invocation.py,sha256=xw0NBIE-6LHd135cx4non-MkGGsia0mYN0lMkmNEucE,435
|
9
9
|
dbt_common/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
dbt_common/record.py,sha256=QLrKppBHYuV7ZTckOMi4Gnz7jLQJcOa5kp4PwK0JmwY,21889
|
11
11
|
dbt_common/semver.py,sha256=Znewz6tc_NBpXr4mZf20bK_RayPL4ODrnxDbkUZrrRo,15034
|
12
12
|
dbt_common/tests.py,sha256=6lC_JuRtoYO6cbAF8-R5aTM4HtQiM_EH8X5m_97duGY,315
|
13
|
-
dbt_common/ui.py,sha256=
|
13
|
+
dbt_common/ui.py,sha256=geIk3ElFj5y_SG5EDc6RMJFEvYGdo-6C21l0pB8I-EU,2934
|
14
14
|
dbt_common/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
15
|
dbt_common/clients/_jinja_blocks.py,sha256=eUjZLBtLCASJRRj1G8b9u15A3PQMDCKvytIdWkTLSP4,15451
|
16
16
|
dbt_common/clients/agate_helper.py,sha256=anKKgKV5PSnFRuFeBwRMdHK3JCaQoUqB2ZXHD0su0Wo,9123
|
@@ -25,21 +25,20 @@ dbt_common/contracts/config/base.py,sha256=vLkmnwWUGazIpUuUYqdnTrpBmFLJQ9hantsIv
|
|
25
25
|
dbt_common/contracts/config/materialization.py,sha256=rahC72qZ0-jB8oPwxyPooZXc5NJ-smg74g2HnGOMj34,256
|
26
26
|
dbt_common/contracts/config/metadata.py,sha256=X47-tEA8q2ZfSMcYv0godUwTSVjt8NI77tD4NqdgM0c,1877
|
27
27
|
dbt_common/contracts/config/properties.py,sha256=gWt6xsP4rVOqRKhmagiUhWnDynzD9mykfMYMTviwpEU,2281
|
28
|
-
dbt_common/events/README.md,sha256=
|
28
|
+
dbt_common/events/README.md,sha256=g-DyrZciHNTB3RrGqhEiw_HJJWBglsdEaXGThxD_lZE,2168
|
29
29
|
dbt_common/events/__init__.py,sha256=av08vfpxo0ek7PqZNtMxY8FODJ3xwph4ehRxgInx4LA,383
|
30
|
-
dbt_common/events/base_types.py,sha256=
|
30
|
+
dbt_common/events/base_types.py,sha256=d_qLgjQre5o_nIW4rkcODjZ21NEfgkUyvofUL9Y7xqg,5506
|
31
31
|
dbt_common/events/contextvars.py,sha256=EIs1P6NrJzx_IAV17x5cVqOAS4Lqbu6oc0etHtWCJOo,3097
|
32
32
|
dbt_common/events/event_handler.py,sha256=jfi0PyqIOGnXCG9HEa0VIVULqNvXs1RYmAg0b50ChQs,1385
|
33
|
-
dbt_common/events/event_manager.py,sha256=
|
33
|
+
dbt_common/events/event_manager.py,sha256=9J-_UYsg3gic82yenrjubCqUq9Ju7xD084-hlbaPr8U,4912
|
34
34
|
dbt_common/events/event_manager_client.py,sha256=5IVdIuRVi5xCNQGiZqXdywlED2kLj1W_Pj0lh2HiDiI,1115
|
35
35
|
dbt_common/events/format.py,sha256=x1RWDZ8G7ZMHmxdld6Q4VXca4kvnhiQOIaQXkC6Uo0Q,1609
|
36
|
-
dbt_common/events/functions.py,sha256=
|
36
|
+
dbt_common/events/functions.py,sha256=2laadmQkHCUuEPHdWCJ2yIKlYSlEkpwD7A6iKKuQpJI,4838
|
37
37
|
dbt_common/events/helpers.py,sha256=29FF0ZR24Zdvk23-bzIZKu8Pb4wFn-B1fFx28lLIpNw,450
|
38
38
|
dbt_common/events/interfaces.py,sha256=hEDeDoB0FW2RYHVZBG7gebEt_mUVBzkn1yPubpaxs-s,147
|
39
39
|
dbt_common/events/logger.py,sha256=siCM47WnjiA5wWoYzHDqe9mIr-b-XYNctP8r3o1zvSc,6800
|
40
|
-
dbt_common/events/types.proto,sha256=ohV5f2KfhaM3NRWHFJBNJQtqP3Hie65smA0imlWNkHg,2425
|
41
40
|
dbt_common/events/types.py,sha256=Xg2QBLTWSM_p2BP_Key_JcygmR1LyNYzQhKVYvZ9Zmc,4683
|
42
|
-
dbt_common/events/types_pb2.py,sha256=
|
41
|
+
dbt_common/events/types_pb2.py,sha256=5-2q4Khin8YHzV6YA0PYo_UgRB9j_q7yRLe8LoR8reM,125
|
43
42
|
dbt_common/exceptions/__init__.py,sha256=X_Uw7BxOzXev_9JMYfs5Cm-_i_Qf2PJim8_-dDJI7Y8,361
|
44
43
|
dbt_common/exceptions/base.py,sha256=23ijq-AtQgUSvZ9JbrCIZ87Pbyn8iEYezX95IXAZ4FY,7783
|
45
44
|
dbt_common/exceptions/cache.py,sha256=0z4fBcdNZMAR41YbPRo2GN0__xAMaYs8Uc-t3hjmVio,2532
|
@@ -57,7 +56,7 @@ dbt_common/utils/encoding.py,sha256=6_kSY2FvGNYMg7oX7PrbvVioieydih3Kl7Ii802LaHI,
|
|
57
56
|
dbt_common/utils/executor.py,sha256=pNY0UbPlwQmTE69Vt_Rj91YGCIOEaqeYU3CjAds0T70,2454
|
58
57
|
dbt_common/utils/formatting.py,sha256=JUn5rzJ-uajs9wPCN0-f2iRFY1pOJF5YjTD9dERuLoc,165
|
59
58
|
dbt_common/utils/jinja.py,sha256=JXgNmJArGGy0h7qkbNLA3zaEQmoF1CxsNBYTlIwFXDw,1101
|
60
|
-
dbt_common-
|
61
|
-
dbt_common-
|
62
|
-
dbt_common-
|
63
|
-
dbt_common-
|
59
|
+
dbt_common-2.0.0.dist-info/METADATA,sha256=Q9L9WVUQ3uBubJ7JKJ4x3ahK-qG8aiR2Z0mQOiY2OM0,4987
|
60
|
+
dbt_common-2.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
61
|
+
dbt_common-2.0.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
62
|
+
dbt_common-2.0.0.dist-info/RECORD,,
|
dbt_common/events/types.proto
DELETED
@@ -1,156 +0,0 @@
|
|
1
|
-
syntax = "proto3";
|
2
|
-
|
3
|
-
package proto_types;
|
4
|
-
|
5
|
-
import "google/protobuf/timestamp.proto";
|
6
|
-
|
7
|
-
// Common event info
|
8
|
-
message EventInfo {
|
9
|
-
string name = 1;
|
10
|
-
string code = 2;
|
11
|
-
string msg = 3;
|
12
|
-
string level = 4;
|
13
|
-
string invocation_id = 5;
|
14
|
-
int32 pid = 6;
|
15
|
-
string thread = 7;
|
16
|
-
google.protobuf.Timestamp ts = 8;
|
17
|
-
map<string, string> extra = 9;
|
18
|
-
string category = 10;
|
19
|
-
}
|
20
|
-
|
21
|
-
// GenericMessage, used for deserializing only
|
22
|
-
message GenericMessage {
|
23
|
-
EventInfo info = 1;
|
24
|
-
}
|
25
|
-
|
26
|
-
// D - Deprecations
|
27
|
-
|
28
|
-
// D018
|
29
|
-
message BehaviorChangeEvent {
|
30
|
-
string flag_name = 1;
|
31
|
-
string flag_source = 2;
|
32
|
-
string description = 3;
|
33
|
-
string docs_url = 4;
|
34
|
-
}
|
35
|
-
|
36
|
-
message BehaviorChangeEventMsg {
|
37
|
-
EventInfo info = 1;
|
38
|
-
BehaviorChangeEvent data = 2;
|
39
|
-
}
|
40
|
-
|
41
|
-
// M - Deps generation
|
42
|
-
|
43
|
-
// M020
|
44
|
-
message RetryExternalCall {
|
45
|
-
int32 attempt = 1;
|
46
|
-
int32 max = 2;
|
47
|
-
}
|
48
|
-
|
49
|
-
message RetryExternalCallMsg {
|
50
|
-
EventInfo info = 1;
|
51
|
-
RetryExternalCall data = 2;
|
52
|
-
}
|
53
|
-
|
54
|
-
// M021
|
55
|
-
message RecordRetryException {
|
56
|
-
string exc = 1;
|
57
|
-
}
|
58
|
-
|
59
|
-
message RecordRetryExceptionMsg {
|
60
|
-
EventInfo info = 1;
|
61
|
-
RecordRetryException data = 2;
|
62
|
-
}
|
63
|
-
|
64
|
-
// Z - Misc
|
65
|
-
|
66
|
-
// Z005
|
67
|
-
message SystemCouldNotWrite {
|
68
|
-
string path = 1;
|
69
|
-
string reason = 2;
|
70
|
-
string exc = 3;
|
71
|
-
}
|
72
|
-
|
73
|
-
message SystemCouldNotWriteMsg {
|
74
|
-
EventInfo info = 1;
|
75
|
-
SystemCouldNotWrite data = 2;
|
76
|
-
}
|
77
|
-
|
78
|
-
// Z006
|
79
|
-
message SystemExecutingCmd {
|
80
|
-
repeated string cmd = 1;
|
81
|
-
}
|
82
|
-
|
83
|
-
message SystemExecutingCmdMsg {
|
84
|
-
EventInfo info = 1;
|
85
|
-
SystemExecutingCmd data = 2;
|
86
|
-
}
|
87
|
-
|
88
|
-
// Z007
|
89
|
-
message SystemStdOut{
|
90
|
-
string bmsg = 1;
|
91
|
-
}
|
92
|
-
|
93
|
-
message SystemStdOutMsg {
|
94
|
-
EventInfo info = 1;
|
95
|
-
SystemStdOut data = 2;
|
96
|
-
}
|
97
|
-
|
98
|
-
// Z008
|
99
|
-
message SystemStdErr {
|
100
|
-
string bmsg = 1;
|
101
|
-
}
|
102
|
-
|
103
|
-
message SystemStdErrMsg {
|
104
|
-
EventInfo info = 1;
|
105
|
-
SystemStdErr data = 2;
|
106
|
-
}
|
107
|
-
|
108
|
-
// Z009
|
109
|
-
message SystemReportReturnCode {
|
110
|
-
int32 returncode = 1;
|
111
|
-
}
|
112
|
-
|
113
|
-
message SystemReportReturnCodeMsg {
|
114
|
-
EventInfo info = 1;
|
115
|
-
SystemReportReturnCode data = 2;
|
116
|
-
}
|
117
|
-
|
118
|
-
// Z017
|
119
|
-
message Formatting {
|
120
|
-
string msg = 1;
|
121
|
-
}
|
122
|
-
|
123
|
-
message FormattingMsg {
|
124
|
-
EventInfo info = 1;
|
125
|
-
Formatting data = 2;
|
126
|
-
}
|
127
|
-
|
128
|
-
// Z050
|
129
|
-
message Note {
|
130
|
-
string msg = 1;
|
131
|
-
}
|
132
|
-
|
133
|
-
message NoteMsg {
|
134
|
-
EventInfo info = 1;
|
135
|
-
Note data = 2;
|
136
|
-
}
|
137
|
-
|
138
|
-
// Z052
|
139
|
-
message PrintEvent {
|
140
|
-
string msg = 1;
|
141
|
-
}
|
142
|
-
|
143
|
-
message PrintEventMsg {
|
144
|
-
EventInfo info = 1;
|
145
|
-
PrintEvent data = 2;
|
146
|
-
}
|
147
|
-
|
148
|
-
// Z053
|
149
|
-
message RecordReplayIssue {
|
150
|
-
string msg = 1;
|
151
|
-
}
|
152
|
-
|
153
|
-
message RecordReplayIssueMsg {
|
154
|
-
EventInfo info = 1;
|
155
|
-
RecordReplayIssue data = 2;
|
156
|
-
}
|
File without changes
|
File without changes
|