dbt-bouncer 1.30.0__py3-none-any.whl → 1.31.2rc1__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.
@@ -18,8 +18,8 @@ class CheckExposureOnModel(BaseCheck):
18
18
  """Exposures should depend on a model.
19
19
 
20
20
  Parameters:
21
- max_number_of_models (Optional[int]): The maximum number of models an exposure can depend on, defaults to 100.
22
- min_number_of_models (Optional[int]): The minimum number of models an exposure can depend on, defaults to 1.
21
+ maximum_number_of_models (Optional[int]): The maximum number of models an exposure can depend on, defaults to 100.
22
+ minimum_number_of_models (Optional[int]): The minimum number of models an exposure can depend on, defaults to 1.
23
23
 
24
24
  Receives:
25
25
  exposure (DbtBouncerExposureBase): The DbtBouncerExposureBase object to check.
@@ -414,6 +414,47 @@ class CheckModelDocumentedInSameDirectory(BaseCheck):
414
414
  )
415
415
 
416
416
 
417
+ class CheckModelFileName(BaseCheck):
418
+ r"""Models must have a file name that matches the supplied regex.
419
+
420
+ Parameters:
421
+ file_name_pattern (str): Regexp the file name must match. Please account for the `.sql` extension.
422
+
423
+ Receives:
424
+ model (DbtBouncerModelBase): The DbtBouncerModelBase object to check.
425
+
426
+ Other Parameters:
427
+ description (Optional[str]): Description of what the check does and why it is implemented.
428
+ exclude (Optional[str]): Regex pattern to match the model path. Model paths that match the pattern will not be checked.
429
+ include (Optional[str]): Regex pattern to match the model path. Only model paths that match the pattern will be checked.
430
+ materialization (Optional[Literal["ephemeral", "incremental", "table", "view"]]): Limit check to models with the specified materialization.
431
+ severity (Optional[Literal["error", "warn"]]): Severity level of the check. Default: `error`.
432
+
433
+ Example(s):
434
+ ```yaml
435
+ manifest_checks:
436
+ - name: check_model_file_name
437
+ description: Marts must include the model version in their file name.
438
+ include: ^models/marts
439
+ file_name_pattern: .*(v[0-9])\.sql$
440
+ ```
441
+
442
+ """
443
+
444
+ file_name_pattern: str
445
+ model: "DbtBouncerModelBase" = Field(default=None)
446
+ name: Literal["check_model_file_name"]
447
+
448
+ def execute(self) -> None:
449
+ """Execute the check."""
450
+ file_name = self.model.original_file_path.split("/")[-1]
451
+ assert (
452
+ re.compile(self.file_name_pattern.strip()).match(file_name) is not None
453
+ ), (
454
+ f"`{get_clean_model_name(self.model.unique_id)}` is in a file that does not match the supplied regex `{self.file_name_pattern.strip()}`."
455
+ )
456
+
457
+
417
458
  class CheckModelGrantPrivilege(BaseCheck):
418
459
  """Model can have grant privileges that match the specified pattern.
419
460
 
@@ -1181,7 +1222,7 @@ class CheckModelNames(BaseCheck):
1181
1222
  re.compile(self.model_name_pattern.strip()).match(self.model.name)
1182
1223
  is not None
1183
1224
  ), (
1184
- f"`{get_clean_model_name(self.model.unique_id)}` does not match the supplied regex `{self.model_name_pattern.strip()})`."
1225
+ f"`{get_clean_model_name(self.model.unique_id)}` does not match the supplied regex `{self.model_name_pattern.strip()}`."
1185
1226
  )
1186
1227
 
1187
1228
 
@@ -271,7 +271,7 @@ def validate_conf(
271
271
  try:
272
272
  return DbtBouncerConf(**config_file_contents)
273
273
  except ValidationError as e:
274
- from Levenshtein import distance
274
+ import jellyfish
275
275
 
276
276
  error_message: List[str] = []
277
277
  for error in e.errors():
@@ -290,7 +290,7 @@ def validate_conf(
290
290
  ].split("', '")
291
291
  min_dist = 100
292
292
  for name in accepted_names:
293
- dist = distance(name, incorrect_name)
293
+ dist = jellyfish.levenshtein_distance(name, incorrect_name)
294
294
  if dist < min_dist:
295
295
  min_dist = dist
296
296
  min_name = name
dbt_bouncer/version.py CHANGED
@@ -5,4 +5,4 @@ def version() -> str:
5
5
  str: The version of `dbt-bouncer`.
6
6
 
7
7
  """
8
- return "1.30.0"
8
+ return "1.31.2rc1"
@@ -1,37 +1,60 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: dbt-bouncer
3
- Version: 1.30.0
3
+ Version: 1.31.2rc1
4
4
  Summary: Configure and enforce conventions for your dbt project.
5
- License: MIT
5
+ Author-email: Padraic Slattery <pgoslatara@gmail.com>
6
+ Maintainer-email: Padraic Slattery <pgoslatara@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: repository, https://github.com/godatadriven/dbt-bouncer
6
9
  Keywords: python,cli,dbt,CI/CD
7
- Author: Padraic Slattery
8
- Author-email: pgoslatara@gmail.com
9
- Maintainer: Padraic Slattery
10
- Maintainer-email: pgoslatara@gmail.com
11
- Requires-Python: >=3.11,<3.14
12
10
  Classifier: Programming Language :: Python
13
11
  Classifier: Programming Language :: Python :: 3
14
12
  Classifier: Programming Language :: Python :: 3 :: Only
15
13
  Classifier: Programming Language :: Python :: 3.11
16
14
  Classifier: Programming Language :: Python :: 3.12
17
15
  Classifier: Programming Language :: Python :: 3.13
18
- Requires-Dist: click (<9)
19
- Requires-Dist: dbt-artifacts-parser (>=0.8)
20
- Requires-Dist: h11 (>=0.16.0)
21
- Requires-Dist: jinja2 (>=3,<4)
22
- Requires-Dist: jinja2-simple-tags (<1)
23
- Requires-Dist: levenshtein (>=0.26.1,<0.27.3)
24
- Requires-Dist: packaging (<25)
25
- Requires-Dist: poetry (>=2.0.1,<3.0.0)
26
- Requires-Dist: progress
27
- Requires-Dist: pydantic (>=2,<3)
28
- Requires-Dist: pyyaml (<7)
29
- Requires-Dist: rapidfuzz (<3.14.0)
30
- Requires-Dist: requests (>=2,<3)
31
- Requires-Dist: semver (<4)
32
- Requires-Dist: tabulate (<1)
33
- Requires-Dist: toml (<1)
16
+ Requires-Python: <3.14,>=3.11
34
17
  Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: click<9
20
+ Requires-Dist: dbt-artifacts-parser>=0.8
21
+ Requires-Dist: h11>=0.16.0
22
+ Requires-Dist: jellyfish<2,>=1
23
+ Requires-Dist: jinja2<4,>=3
24
+ Requires-Dist: jinja2-simple-tags<1
25
+ Requires-Dist: packaging<25
26
+ Requires-Dist: progress
27
+ Requires-Dist: pydantic<3,>=2
28
+ Requires-Dist: pyyaml<7
29
+ Requires-Dist: requests<3,>=2
30
+ Requires-Dist: tabulate<1
31
+ Requires-Dist: toml<1
32
+ Requires-Dist: semver<4
33
+ Provides-Extra: dev
34
+ Requires-Dist: autoflake~=2.0; extra == "dev"
35
+ Requires-Dist: black~=25.0; extra == "dev"
36
+ Requires-Dist: dbt-core<2,>=1.10.0; extra == "dev"
37
+ Requires-Dist: dbt-duckdb~=1.0; extra == "dev"
38
+ Requires-Dist: isort~=7.0; extra == "dev"
39
+ Requires-Dist: mypy~=1.0; extra == "dev"
40
+ Requires-Dist: pre-commit<5,>=3; extra == "dev"
41
+ Requires-Dist: pytest<=10; extra == "dev"
42
+ Requires-Dist: pytest-cov<8,>=5; extra == "dev"
43
+ Requires-Dist: pytest-xdist~=3.0; extra == "dev"
44
+ Requires-Dist: ruff~=0.0; extra == "dev"
45
+ Requires-Dist: shandy-sqlfmt[jinjafmt]~=0.0; extra == "dev"
46
+ Requires-Dist: types-PyYaml~=6.0; extra == "dev"
47
+ Requires-Dist: types-tabulate~=0.0; extra == "dev"
48
+ Requires-Dist: types-toml~=0.0; extra == "dev"
49
+ Provides-Extra: docs
50
+ Requires-Dist: mike~=2.0; extra == "docs"
51
+ Requires-Dist: mkdocs~=1.0; extra == "docs"
52
+ Requires-Dist: mkdocstrings-python<2; extra == "docs"
53
+ Requires-Dist: mkdocs-click~=0.0; extra == "docs"
54
+ Requires-Dist: mkdocs-git-revision-date-localized-plugin~=1.0; extra == "docs"
55
+ Requires-Dist: mkdocs-material~=9.0; extra == "docs"
56
+ Requires-Dist: pymdown-extensions~=10.0; extra == "docs"
57
+ Dynamic: license-file
35
58
 
36
59
  <p align="center">
37
60
  <img src="https://github.com/godatadriven/dbt-bouncer/raw/main/docs/assets/logo.svg" alt="dbt-bouncer logo" width="500"/>
@@ -146,4 +169,3 @@ All documentation can be found on `dbt-bouncer` [documentation website](https://
146
169
  ## Code of Conduct
147
170
 
148
171
  Everyone interacting in `dbt-bouncer`'s codebase, issue trackers, chat rooms, and mailing lists is expected to follow the [Code of Conduct](./CODE_OF_CONDUCT.md).
149
-
@@ -1,35 +1,35 @@
1
1
  dbt_bouncer/__init__.py,sha256=vJ9zw-0crTEO2MzmPQUUCebBQCSYiOleGNUUx_eX3eo,33
2
- dbt_bouncer/artifact_parsers/dbt_cloud/README.md,sha256=MOOGbm2KHjlcvtiSxDVnQlCXwNBfyveV71b7zgR1g_E,429
3
- dbt_bouncer/artifact_parsers/dbt_cloud/catalog_latest.py,sha256=W575XZj7U9fC7recAUzf63cFBh4gghyjYSVYmoKGN5Q,2062
4
- dbt_bouncer/artifact_parsers/dbt_cloud/manifest_latest.py,sha256=EPgjUz2pRW2nS1_ZgLgXK9douoymKJ5vRk7VM3Emm0w,117707
5
- dbt_bouncer/artifact_parsers/dbt_cloud/run_results_latest.py,sha256=d_bCyY3AM77UEemKnPlHCDcRF_UmfAO_vmPiNQ2kHIY,2111
2
+ dbt_bouncer/check_base.py,sha256=haCZiOn-7cod2XPWoOjUozJVVV7JGOK8OSwvZYsLwTw,2565
3
+ dbt_bouncer/config_file_parser.py,sha256=JjFoPhFARgPB_q8BnjRp9C9E5FhO1mcBWrDYEyeOfc4,5009
4
+ dbt_bouncer/config_file_validator.py,sha256=CzuEh_1cNQ-2zl7TA-9RKMECOAOoxcQLgODh9-7JHwA,11262
5
+ dbt_bouncer/logger.py,sha256=qkwB-SVUE4YUUp-MtmbcDPUX7t3zdniQL5Linuomr94,1804
6
+ dbt_bouncer/main.py,sha256=n-jOsKlDwAlB2uF__J_DtkU8BC7CqeKMOU_f8axB1fo,6433
7
+ dbt_bouncer/runner.py,sha256=fdgpOUS8ckS_rZbklOUqFSxmD6I8WYRhQU09HZI0Ghs,10628
8
+ dbt_bouncer/utils.py,sha256=-jZjc6R0tjHWqpTjgHIb7Ej6Cqwdbchbl7L8IB4mo1I,9890
9
+ dbt_bouncer/version.py,sha256=Lsn8ViHLb4BMxSRmvtxI6fcD6N2Z8BLRn6D4mMMm_Wg,152
6
10
  dbt_bouncer/artifact_parsers/parsers_catalog.py,sha256=2VbD3zib0jZdy7SCaYNQeYDXlxKpQykgOY7rUNnjQH0,3130
7
11
  dbt_bouncer/artifact_parsers/parsers_common.py,sha256=KAbnDHPnC2uHn91FK8UZ8wYOs-jTBYQSzyuowKxCSUU,6729
8
12
  dbt_bouncer/artifact_parsers/parsers_manifest.py,sha256=I9UnoNIHiAXXMGkZ-JEAbYKT6oGgBFtIUoOx14HeReU,9644
9
13
  dbt_bouncer/artifact_parsers/parsers_run_results.py,sha256=Qv6HhHmD1jxFPypgvmexl5JfVEaltREiCikJPIYQ9dE,3786
10
- dbt_bouncer/check_base.py,sha256=haCZiOn-7cod2XPWoOjUozJVVV7JGOK8OSwvZYsLwTw,2565
14
+ dbt_bouncer/artifact_parsers/dbt_cloud/catalog_latest.py,sha256=W575XZj7U9fC7recAUzf63cFBh4gghyjYSVYmoKGN5Q,2062
15
+ dbt_bouncer/artifact_parsers/dbt_cloud/manifest_latest.py,sha256=EPgjUz2pRW2nS1_ZgLgXK9douoymKJ5vRk7VM3Emm0w,117707
16
+ dbt_bouncer/artifact_parsers/dbt_cloud/run_results_latest.py,sha256=d_bCyY3AM77UEemKnPlHCDcRF_UmfAO_vmPiNQ2kHIY,2111
17
+ dbt_bouncer/checks/common.py,sha256=WTaZZ1vQpi1AfTu_8OLlfADngeNiVAmQ5lVaeYNUBtc,192
11
18
  dbt_bouncer/checks/catalog/check_catalog_sources.py,sha256=680dT_lqEem73X9Ur27-GiUskj7ALHaA16HdOUIePAo,2278
12
19
  dbt_bouncer/checks/catalog/check_columns.py,sha256=uQoFGW3CDxdsFPVtmGIxbm_gVwUr9AF02zfO-3D8-1s,16124
13
- dbt_bouncer/checks/common.py,sha256=WTaZZ1vQpi1AfTu_8OLlfADngeNiVAmQ5lVaeYNUBtc,192
14
- dbt_bouncer/checks/manifest/check_exposures.py,sha256=JLHpbIpm1TmFieU88RrKRcJUdtdnHdOb17SL3p55bY8,7077
20
+ dbt_bouncer/checks/manifest/check_exposures.py,sha256=qPeKwIuDmnsu5_eBgco64RYpSzhq1UueutOz-9Cpah4,7085
15
21
  dbt_bouncer/checks/manifest/check_lineage.py,sha256=EHUXdR5D-ihwdwfvrIGewH8bL2yHXi1cfghv3VFe1I0,5949
16
22
  dbt_bouncer/checks/manifest/check_macros.py,sha256=RzkKCBcyLHGKvKFZ1Cn_QGTAEjH_T_z_8IazKOJZH3c,12318
17
23
  dbt_bouncer/checks/manifest/check_metadata.py,sha256=E9M-EXHU9JcR__5FotvVbhWc0M-H-JieB-9Wzbunsxg,2199
18
- dbt_bouncer/checks/manifest/check_models.py,sha256=38LIoiJE_7QY6t4HQFE4Th0FrbGlwk7O8QMXVMhsXLA,66075
24
+ dbt_bouncer/checks/manifest/check_models.py,sha256=_6wL2aMNUSOqk3dInbLpcOYhVGoORnkd9HRjBTcoVTk,67851
19
25
  dbt_bouncer/checks/manifest/check_semantic_models.py,sha256=GFVPCn16PcNlXFLCbWMEG6NADccJnxC-latmBQ23OrU,2500
20
26
  dbt_bouncer/checks/manifest/check_snapshots.py,sha256=jmQNNVDn2s4UMJd0P7NAzzPPLIXWiDuE9qKTRiA4430,3795
21
27
  dbt_bouncer/checks/manifest/check_sources.py,sha256=HW-uZ9toO9veNaahAdxqquerC85zwaTJKQmRhvn8qbo,17092
22
28
  dbt_bouncer/checks/manifest/check_unit_tests.py,sha256=3_0FG91nSfC3k_dBDrJgRjF8rpzeA6GKSr3DmDP0ZTo,8417
23
29
  dbt_bouncer/checks/run_results/check_run_results.py,sha256=LLX8Uziyc4hv303K31wLtuXMXng3WVJF2z1j_GbogAI,4117
24
- dbt_bouncer/config_file_parser.py,sha256=JjFoPhFARgPB_q8BnjRp9C9E5FhO1mcBWrDYEyeOfc4,5009
25
- dbt_bouncer/config_file_validator.py,sha256=wB241_aV0HTX_NLLfdD2snI831MsRIWdO5Y2lRdx7Ug,11256
26
- dbt_bouncer/logger.py,sha256=qkwB-SVUE4YUUp-MtmbcDPUX7t3zdniQL5Linuomr94,1804
27
- dbt_bouncer/main.py,sha256=n-jOsKlDwAlB2uF__J_DtkU8BC7CqeKMOU_f8axB1fo,6433
28
- dbt_bouncer/runner.py,sha256=fdgpOUS8ckS_rZbklOUqFSxmD6I8WYRhQU09HZI0Ghs,10628
29
- dbt_bouncer/utils.py,sha256=-jZjc6R0tjHWqpTjgHIb7Ej6Cqwdbchbl7L8IB4mo1I,9890
30
- dbt_bouncer/version.py,sha256=peiKdfhYuV1tr1aFIP2HBNzq0JXTP49RcFqmcJrN-pY,149
31
- dbt_bouncer-1.30.0.dist-info/LICENSE,sha256=gGXp4VL__ZWlTWhXHRjWJmkxl5X9UJ7L7n1dr2WlfsY,1074
32
- dbt_bouncer-1.30.0.dist-info/METADATA,sha256=hLea625CoInl_srhE31N6XADFivQPGSQMLbIEeTV-uQ,4606
33
- dbt_bouncer-1.30.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
34
- dbt_bouncer-1.30.0.dist-info/entry_points.txt,sha256=jEl2FZDm4gO8u4x9m8qS0zMf9Fk2FAwLfI4N4sreGxI,52
35
- dbt_bouncer-1.30.0.dist-info/RECORD,,
30
+ dbt_bouncer-1.31.2rc1.dist-info/licenses/LICENSE,sha256=gGXp4VL__ZWlTWhXHRjWJmkxl5X9UJ7L7n1dr2WlfsY,1074
31
+ dbt_bouncer-1.31.2rc1.dist-info/METADATA,sha256=HtS_Q0WKevt10RjYlZOqJp37OG4LIEnbQ1ckJl0VY-c,5716
32
+ dbt_bouncer-1.31.2rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
+ dbt_bouncer-1.31.2rc1.dist-info/entry_points.txt,sha256=BGHZ6oZsZjq5MUVKYSdbwy80f7cEOCTC-UqqEN1GrBg,53
34
+ dbt_bouncer-1.31.2rc1.dist-info/top_level.txt,sha256=TnVuJYP3nH_F7nkc63iXA34kAnwrOWWDpTUyd-GLpR4,12
35
+ dbt_bouncer-1.31.2rc1.dist-info/RECORD,,
@@ -1,4 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.0.1
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dbt-bouncer = dbt_bouncer.main:cli
@@ -0,0 +1 @@
1
+ dbt_bouncer
@@ -1,3 +0,0 @@
1
- dbt Cloud now supports a "versionless" mode. Unfortunately `dbt-artifacts-parser` does not support any modifications to the schema od dbt artifacts using this mode, see [here](https://github.com/yu-iskw/dbt-artifacts-parser/pull/112#issuecomment-2360298424) for more info.
2
-
3
- The purpose of this directory is to extend `dbt-artifacts-parser` to support dbt Cloud versionless mode by modifying the expected schema of dbt artifacts.
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- dbt-bouncer=dbt_bouncer.main:cli
3
-