dbt-bouncer 1.30.0__py3-none-any.whl → 1.31.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.
@@ -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.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dbt-bouncer
3
- Version: 1.30.0
3
+ Version: 1.31.0
4
4
  Summary: Configure and enforce conventions for your dbt project.
5
5
  License: MIT
6
6
  Keywords: python,cli,dbt,CI/CD
@@ -18,15 +18,14 @@ Classifier: Programming Language :: Python :: 3.13
18
18
  Requires-Dist: click (<9)
19
19
  Requires-Dist: dbt-artifacts-parser (>=0.8)
20
20
  Requires-Dist: h11 (>=0.16.0)
21
+ Requires-Dist: jellyfish (>=1,<2)
21
22
  Requires-Dist: jinja2 (>=3,<4)
22
23
  Requires-Dist: jinja2-simple-tags (<1)
23
- Requires-Dist: levenshtein (>=0.26.1,<0.27.3)
24
24
  Requires-Dist: packaging (<25)
25
25
  Requires-Dist: poetry (>=2.0.1,<3.0.0)
26
26
  Requires-Dist: progress
27
27
  Requires-Dist: pydantic (>=2,<3)
28
28
  Requires-Dist: pyyaml (<7)
29
- Requires-Dist: rapidfuzz (<3.14.0)
30
29
  Requires-Dist: requests (>=2,<3)
31
30
  Requires-Dist: semver (<4)
32
31
  Requires-Dist: tabulate (<1)
@@ -15,21 +15,21 @@ dbt_bouncer/checks/manifest/check_exposures.py,sha256=JLHpbIpm1TmFieU88RrKRcJUdt
15
15
  dbt_bouncer/checks/manifest/check_lineage.py,sha256=EHUXdR5D-ihwdwfvrIGewH8bL2yHXi1cfghv3VFe1I0,5949
16
16
  dbt_bouncer/checks/manifest/check_macros.py,sha256=RzkKCBcyLHGKvKFZ1Cn_QGTAEjH_T_z_8IazKOJZH3c,12318
17
17
  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
18
+ dbt_bouncer/checks/manifest/check_models.py,sha256=_6wL2aMNUSOqk3dInbLpcOYhVGoORnkd9HRjBTcoVTk,67851
19
19
  dbt_bouncer/checks/manifest/check_semantic_models.py,sha256=GFVPCn16PcNlXFLCbWMEG6NADccJnxC-latmBQ23OrU,2500
20
20
  dbt_bouncer/checks/manifest/check_snapshots.py,sha256=jmQNNVDn2s4UMJd0P7NAzzPPLIXWiDuE9qKTRiA4430,3795
21
21
  dbt_bouncer/checks/manifest/check_sources.py,sha256=HW-uZ9toO9veNaahAdxqquerC85zwaTJKQmRhvn8qbo,17092
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=JjFoPhFARgPB_q8BnjRp9C9E5FhO1mcBWrDYEyeOfc4,5009
25
- dbt_bouncer/config_file_validator.py,sha256=wB241_aV0HTX_NLLfdD2snI831MsRIWdO5Y2lRdx7Ug,11256
25
+ dbt_bouncer/config_file_validator.py,sha256=CzuEh_1cNQ-2zl7TA-9RKMECOAOoxcQLgODh9-7JHwA,11262
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=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/version.py,sha256=NIgQ5GyBGmKGN84RmI-mVCHRQ_p4bpDtNvw7HjOSyoc,149
31
+ dbt_bouncer-1.31.0.dist-info/LICENSE,sha256=gGXp4VL__ZWlTWhXHRjWJmkxl5X9UJ7L7n1dr2WlfsY,1074
32
+ dbt_bouncer-1.31.0.dist-info/METADATA,sha256=YToLrYtxtaP_barhthVy1JIEfrG8ZPIMudpTSflmUdQ,4559
33
+ dbt_bouncer-1.31.0.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
34
+ dbt_bouncer-1.31.0.dist-info/entry_points.txt,sha256=jEl2FZDm4gO8u4x9m8qS0zMf9Fk2FAwLfI4N4sreGxI,52
35
+ dbt_bouncer-1.31.0.dist-info/RECORD,,