dbt-common 1.10.0__py3-none-any.whl → 1.11.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.10.0"
1
+ version = "1.11.0"
@@ -470,11 +470,16 @@ def create_undefined(node: Optional[_NodeProtocol] = None) -> Type[jinja2.Undefi
470
470
  return Undefined
471
471
 
472
472
 
473
+ def is_list(value):
474
+ return isinstance(value, list)
475
+
476
+
473
477
  NATIVE_FILTERS: Dict[str, Callable[[Any], Any]] = {
474
478
  "as_text": TextMarker,
475
479
  "as_bool": BoolMarker,
476
480
  "as_native": NativeMarker,
477
481
  "as_number": NumberMarker,
482
+ "is_list": is_list,
478
483
  }
479
484
 
480
485
 
@@ -483,6 +488,7 @@ TEXT_FILTERS: Dict[str, Callable[[Any], Any]] = {
483
488
  "as_bool": lambda x: x,
484
489
  "as_native": lambda x: x,
485
490
  "as_number": lambda x: x,
491
+ "is_list": is_list,
486
492
  }
487
493
 
488
494
 
@@ -2,7 +2,6 @@ from enum import Enum
2
2
  import os
3
3
  import threading
4
4
  from dbt_common.events import types_pb2
5
- import sys
6
5
  from google.protobuf.json_format import ParseDict, MessageToDict, MessageToJson
7
6
  from google.protobuf.message import Message
8
7
  from dbt_common.events.helpers import get_json_string_utcnow
@@ -65,14 +64,14 @@ class BaseEvent:
65
64
  kwargs["msg"] = str(kwargs["msg"])
66
65
  try:
67
66
  self.pb_msg = ParseDict(kwargs, msg_cls())
68
- except Exception:
67
+ except Exception as exc:
69
68
  # Imports need to be here to avoid circular imports
70
69
  from dbt_common.events.types import Note
71
70
  from dbt_common.events.functions import fire_event
72
71
 
73
- error_msg = f"[{class_name}]: Unable to parse dict {kwargs}"
72
+ error_msg = f"[{class_name}]: Unable to parse logging event dictionary. {exc}. Dictionary: {kwargs}"
74
73
  # If we're testing throw an error so that we notice failures
75
- if "pytest" in sys.modules:
74
+ if os.getenv("PYTEST_CURRENT_TEST"):
76
75
  raise Exception(error_msg)
77
76
  else:
78
77
  fire_event(Note(msg=error_msg), level=EventLevel.WARN)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dbt-common
3
- Version: 1.10.0
3
+ Version: 1.11.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
@@ -1,4 +1,4 @@
1
- dbt_common/__about__.py,sha256=TYlk0Tf1qPZKLC0jdqErUbXT7WMC6rSmxnveyAPBB4Y,19
1
+ dbt_common/__about__.py,sha256=mD8RxZIPreXVMDcN4OLaJBmakjmOUITJu4JM34eJwD8,19
2
2
  dbt_common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  dbt_common/behavior_flags.py,sha256=tflh5PubIgEuogslprvnOEA2tM7e7opK6i8GOTnwrgw,4883
4
4
  dbt_common/constants.py,sha256=-Y5DIL1SDPQWtlCNizXRYxFgbx1D7LaLs1ysamvGMRk,278
@@ -14,7 +14,7 @@ dbt_common/ui.py,sha256=rc2TEM29raBFc_LXcg901pMDD07C2ohwp9qzkE-7pBY,2567
14
14
  dbt_common/clients/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  dbt_common/clients/_jinja_blocks.py,sha256=xoJK9Y0F93U2PKfT_3SJbBopCGYCtl7LiwKuylXnrEE,12947
16
16
  dbt_common/clients/agate_helper.py,sha256=anKKgKV5PSnFRuFeBwRMdHK3JCaQoUqB2ZXHD0su0Wo,9123
17
- dbt_common/clients/jinja.py,sha256=-eDrUnhH3nxOD0xu81jlweJ_iJqIWdJpYSHZBB27xXo,19682
17
+ dbt_common/clients/jinja.py,sha256=GzpW1BN3W-__YFQ2amyx85Z_qwOOZXEwjmoTIr70HlA,19787
18
18
  dbt_common/clients/system.py,sha256=aoUBtOuXVmkOyj6IhhJ3Y4a7JFzPO2F_zKyOtz3xy44,23932
19
19
  dbt_common/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  dbt_common/contracts/constraints.py,sha256=_f1q3Rkcg2UwA7zI5XBbUMXnPUg6pw17UC7l1HyhyQM,1352
@@ -27,7 +27,7 @@ dbt_common/contracts/config/metadata.py,sha256=X47-tEA8q2ZfSMcYv0godUwTSVjt8NI77
27
27
  dbt_common/contracts/config/properties.py,sha256=gWt6xsP4rVOqRKhmagiUhWnDynzD9mykfMYMTviwpEU,2281
28
28
  dbt_common/events/README.md,sha256=CSwVajoxCAqOug2UCnXldH1EUK7Kjf3rcq7z9ACjrss,3023
29
29
  dbt_common/events/__init__.py,sha256=av08vfpxo0ek7PqZNtMxY8FODJ3xwph4ehRxgInx4LA,383
30
- dbt_common/events/base_types.py,sha256=1l4Yx8zuma7jABB1fcPvL20ltpQ46w0mlYxn48kHykY,5415
30
+ dbt_common/events/base_types.py,sha256=MHlj-DzOmhG9Ds2kNqXtSWxmy_RlwAOFVKu6-WVs3Ik,5460
31
31
  dbt_common/events/contextvars.py,sha256=EIs1P6NrJzx_IAV17x5cVqOAS4Lqbu6oc0etHtWCJOo,3097
32
32
  dbt_common/events/event_handler.py,sha256=jfi0PyqIOGnXCG9HEa0VIVULqNvXs1RYmAg0b50ChQs,1385
33
33
  dbt_common/events/event_manager.py,sha256=IIUwSyt_RcBbUI_iE5mnpmZt2uW7lG49RXOWz2VlUv0,2300
@@ -57,7 +57,7 @@ dbt_common/utils/encoding.py,sha256=6_kSY2FvGNYMg7oX7PrbvVioieydih3Kl7Ii802LaHI,
57
57
  dbt_common/utils/executor.py,sha256=pNY0UbPlwQmTE69Vt_Rj91YGCIOEaqeYU3CjAds0T70,2454
58
58
  dbt_common/utils/formatting.py,sha256=JUn5rzJ-uajs9wPCN0-f2iRFY1pOJF5YjTD9dERuLoc,165
59
59
  dbt_common/utils/jinja.py,sha256=JXgNmJArGGy0h7qkbNLA3zaEQmoF1CxsNBYTlIwFXDw,1101
60
- dbt_common-1.10.0.dist-info/METADATA,sha256=6Syhedl_DalAK-ulziTBfmy-VA-uQ4jVKo3s5hLkZPc,5299
61
- dbt_common-1.10.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
62
- dbt_common-1.10.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
63
- dbt_common-1.10.0.dist-info/RECORD,,
60
+ dbt_common-1.11.0.dist-info/METADATA,sha256=MQj_0ruvmXW57fvRN94WNtYjX71MDdxcaYic-a9QrOg,5299
61
+ dbt_common-1.11.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
62
+ dbt_common-1.11.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
63
+ dbt_common-1.11.0.dist-info/RECORD,,