dbt-bouncer 1.27.1a2__py3-none-any.whl → 1.29.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_bouncer/checks/catalog/check_columns.py +22 -6
- dbt_bouncer/config_file_validator.py +10 -2
- dbt_bouncer/version.py +1 -1
- {dbt_bouncer-1.27.1a2.dist-info → dbt_bouncer-1.29.0.dist-info}/METADATA +1 -1
- {dbt_bouncer-1.27.1a2.dist-info → dbt_bouncer-1.29.0.dist-info}/RECORD +8 -8
- {dbt_bouncer-1.27.1a2.dist-info → dbt_bouncer-1.29.0.dist-info}/LICENSE +0 -0
- {dbt_bouncer-1.27.1a2.dist-info → dbt_bouncer-1.29.0.dist-info}/WHEEL +0 -0
- {dbt_bouncer-1.27.1a2.dist-info → dbt_bouncer-1.29.0.dist-info}/entry_points.txt +0 -0
|
@@ -13,11 +13,11 @@ if TYPE_CHECKING:
|
|
|
13
13
|
from dbt_artifacts_parser.parsers.catalog.catalog_v1 import (
|
|
14
14
|
Nodes as CatalogNodes,
|
|
15
15
|
)
|
|
16
|
+
from dbt_bouncer.artifact_parsers.parsers_common import DbtBouncerManifest
|
|
16
17
|
from dbt_bouncer.artifact_parsers.parsers_manifest import (
|
|
17
18
|
DbtBouncerModelBase,
|
|
18
19
|
DbtBouncerTestBase,
|
|
19
20
|
)
|
|
20
|
-
|
|
21
21
|
from pydantic import model_validator
|
|
22
22
|
|
|
23
23
|
from dbt_bouncer.check_base import BaseCheck
|
|
@@ -282,7 +282,9 @@ class CheckColumnsAreAllDocumented(BaseCheck):
|
|
|
282
282
|
"""All columns in a model should be included in the model's properties file, i.e. `.yml` file.
|
|
283
283
|
|
|
284
284
|
Receives:
|
|
285
|
+
case_sensitive (Optional[bool]): Whether the column names are case sensitive or not. Necessary for adapters like `dbt-snowflake` where the column in `catalog.json` is uppercase but the column in `manifest.json` can be lowercase. Defaults to `false` for `dbt-snowflake`, otherwise `true`.
|
|
285
286
|
catalog_node (CatalogNodes): The CatalogNodes object to check.
|
|
287
|
+
manifest_obj (DbtBouncerManifest): The DbtBouncerManifest object parsed from `manifest.json`.
|
|
286
288
|
models (List[DbtBouncerModelBase]): List of DbtBouncerModelBase objects parsed from `manifest.json`.
|
|
287
289
|
|
|
288
290
|
Other Parameters:
|
|
@@ -299,7 +301,9 @@ class CheckColumnsAreAllDocumented(BaseCheck):
|
|
|
299
301
|
|
|
300
302
|
"""
|
|
301
303
|
|
|
304
|
+
case_sensitive: Optional[bool] = Field(default=True)
|
|
302
305
|
catalog_node: "CatalogNodes" = Field(default=None)
|
|
306
|
+
manifest_obj: "DbtBouncerManifest" = Field(default=None)
|
|
303
307
|
models: List["DbtBouncerModelBase"] = Field(default=[])
|
|
304
308
|
name: Literal["check_columns_are_all_documented"]
|
|
305
309
|
|
|
@@ -309,11 +313,23 @@ class CheckColumnsAreAllDocumented(BaseCheck):
|
|
|
309
313
|
model = next(
|
|
310
314
|
m for m in self.models if m.unique_id == self.catalog_node.unique_id
|
|
311
315
|
)
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
316
|
+
|
|
317
|
+
if self.manifest_obj.manifest.metadata.adapter_type in ["snowflake"]:
|
|
318
|
+
self.case_sensitive = False
|
|
319
|
+
|
|
320
|
+
if self.case_sensitive:
|
|
321
|
+
undocumented_columns = [
|
|
322
|
+
v.name
|
|
323
|
+
for _, v in self.catalog_node.columns.items()
|
|
324
|
+
if v.name not in model.columns
|
|
325
|
+
]
|
|
326
|
+
else:
|
|
327
|
+
undocumented_columns = [
|
|
328
|
+
v.name
|
|
329
|
+
for _, v in self.catalog_node.columns.items()
|
|
330
|
+
if v.name.lower() not in [c.lower() for c in model.columns]
|
|
331
|
+
]
|
|
332
|
+
|
|
317
333
|
assert not undocumented_columns, (
|
|
318
334
|
f"`{self.catalog_node.unique_id.split('.')[-1]}` has columns that are not included in the models properties file: {undocumented_columns}"
|
|
319
335
|
)
|
|
@@ -89,8 +89,9 @@ def get_config_file_path(
|
|
|
89
89
|
"""Get the path to the config file for dbt-bouncer. This is fetched from (in order):
|
|
90
90
|
|
|
91
91
|
1. The file passed via the `--config-file` CLI flag.
|
|
92
|
-
2.
|
|
93
|
-
3. A `
|
|
92
|
+
2. The file passed via the `DBT_BOUNCER_CONFIG_FILE` environment variable.
|
|
93
|
+
3. A file named `dbt-bouncer.yml` in the current working directory.
|
|
94
|
+
4. A `[tool.dbt-bouncer]` section in `pyproject.toml` (in current working directory or parent directories).
|
|
94
95
|
|
|
95
96
|
Returns:
|
|
96
97
|
PurePath: Config file for dbt-bouncer.
|
|
@@ -106,6 +107,12 @@ def get_config_file_path(
|
|
|
106
107
|
logging.debug(f"Config file passed via command line: {config_file}")
|
|
107
108
|
return config_file
|
|
108
109
|
|
|
110
|
+
if config_file_path_via_env_var := os.getenv("DBT_BOUNCER_CONFIG_FILE"):
|
|
111
|
+
logging.debug(
|
|
112
|
+
f"Config file passed via environment variable: {config_file_path_via_env_var}"
|
|
113
|
+
)
|
|
114
|
+
return Path(config_file_path_via_env_var)
|
|
115
|
+
|
|
109
116
|
if config_file_source == "DEFAULT":
|
|
110
117
|
logging.debug(f"Using default value for config file: {config_file}")
|
|
111
118
|
config_file_path = Path.cwd() / config_file
|
|
@@ -218,6 +225,7 @@ def validate_conf(
|
|
|
218
225
|
DbtBouncerCatalogNode,
|
|
219
226
|
)
|
|
220
227
|
from dbt_bouncer.artifact_parsers.parsers_manifest import (
|
|
228
|
+
DbtBouncerManifest,
|
|
221
229
|
DbtBouncerModelBase,
|
|
222
230
|
DbtBouncerSnapshotBase,
|
|
223
231
|
DbtBouncerSourceBase,
|
dbt_bouncer/version.py
CHANGED
|
@@ -9,7 +9,7 @@ dbt_bouncer/artifact_parsers/parsers_manifest.py,sha256=hBQTi1QuMFKvAN9GEXAZVndE
|
|
|
9
9
|
dbt_bouncer/artifact_parsers/parsers_run_results.py,sha256=ceySu_s4in_ArBFYG_I0fE5A_eSpOtMzAejVbIlqOSk,3710
|
|
10
10
|
dbt_bouncer/check_base.py,sha256=haCZiOn-7cod2XPWoOjUozJVVV7JGOK8OSwvZYsLwTw,2565
|
|
11
11
|
dbt_bouncer/checks/catalog/check_catalog_sources.py,sha256=680dT_lqEem73X9Ur27-GiUskj7ALHaA16HdOUIePAo,2278
|
|
12
|
-
dbt_bouncer/checks/catalog/check_columns.py,sha256=
|
|
12
|
+
dbt_bouncer/checks/catalog/check_columns.py,sha256=uQoFGW3CDxdsFPVtmGIxbm_gVwUr9AF02zfO-3D8-1s,16124
|
|
13
13
|
dbt_bouncer/checks/common.py,sha256=WTaZZ1vQpi1AfTu_8OLlfADngeNiVAmQ5lVaeYNUBtc,192
|
|
14
14
|
dbt_bouncer/checks/manifest/check_exposures.py,sha256=JLHpbIpm1TmFieU88RrKRcJUdtdnHdOb17SL3p55bY8,7077
|
|
15
15
|
dbt_bouncer/checks/manifest/check_lineage.py,sha256=Q0K6iA_Va4DYLwMjuRoDBYrjE2GdvVU0gvVBFtf0cq0,5850
|
|
@@ -22,14 +22,14 @@ dbt_bouncer/checks/manifest/check_sources.py,sha256=HW-uZ9toO9veNaahAdxqquerC85z
|
|
|
22
22
|
dbt_bouncer/checks/manifest/check_unit_tests.py,sha256=3_0FG91nSfC3k_dBDrJgRjF8rpzeA6GKSr3DmDP0ZTo,8417
|
|
23
23
|
dbt_bouncer/checks/run_results/check_run_results.py,sha256=LLX8Uziyc4hv303K31wLtuXMXng3WVJF2z1j_GbogAI,4117
|
|
24
24
|
dbt_bouncer/config_file_parser.py,sha256=gq7fINTmLFVWR4todXkPd_dnh0-9vnM3jHYtgk1g_WU,4874
|
|
25
|
-
dbt_bouncer/config_file_validator.py,sha256=
|
|
25
|
+
dbt_bouncer/config_file_validator.py,sha256=wB241_aV0HTX_NLLfdD2snI831MsRIWdO5Y2lRdx7Ug,11256
|
|
26
26
|
dbt_bouncer/logger.py,sha256=qkwB-SVUE4YUUp-MtmbcDPUX7t3zdniQL5Linuomr94,1804
|
|
27
27
|
dbt_bouncer/main.py,sha256=n-jOsKlDwAlB2uF__J_DtkU8BC7CqeKMOU_f8axB1fo,6433
|
|
28
28
|
dbt_bouncer/runner.py,sha256=fdgpOUS8ckS_rZbklOUqFSxmD6I8WYRhQU09HZI0Ghs,10628
|
|
29
29
|
dbt_bouncer/utils.py,sha256=-jZjc6R0tjHWqpTjgHIb7Ej6Cqwdbchbl7L8IB4mo1I,9890
|
|
30
|
-
dbt_bouncer/version.py,sha256=
|
|
31
|
-
dbt_bouncer-1.
|
|
32
|
-
dbt_bouncer-1.
|
|
33
|
-
dbt_bouncer-1.
|
|
34
|
-
dbt_bouncer-1.
|
|
35
|
-
dbt_bouncer-1.
|
|
30
|
+
dbt_bouncer/version.py,sha256=T6qaKJ5jDdQcME1sfophY-dqPLnCjO2lXd6l-yLY1UA,149
|
|
31
|
+
dbt_bouncer-1.29.0.dist-info/LICENSE,sha256=gGXp4VL__ZWlTWhXHRjWJmkxl5X9UJ7L7n1dr2WlfsY,1074
|
|
32
|
+
dbt_bouncer-1.29.0.dist-info/METADATA,sha256=T1O24rYH597lJNTxlMnV1zegkZoJFoxEdDT8eJRNO9Q,4606
|
|
33
|
+
dbt_bouncer-1.29.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
|
34
|
+
dbt_bouncer-1.29.0.dist-info/entry_points.txt,sha256=jEl2FZDm4gO8u4x9m8qS0zMf9Fk2FAwLfI4N4sreGxI,52
|
|
35
|
+
dbt_bouncer-1.29.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|