dbt-bouncer 2.0.0rc1__py3-none-any.whl → 2.1.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/main.py CHANGED
@@ -192,7 +192,7 @@ def run_bouncer(
192
192
  return results[0]
193
193
 
194
194
 
195
- @click.command()
195
+ @click.group(invoke_without_command=True)
196
196
  @click.option(
197
197
  "--config-file",
198
198
  default=Path("dbt-bouncer.yml"),
@@ -246,15 +246,59 @@ def cli(
246
246
  verbosity: int,
247
247
  ) -> None:
248
248
  """Entrypoint for dbt-bouncer."""
249
- config_file_source = ctx.get_parameter_source("config_file").name # type: ignore[union-attr]
250
- exit_code = run_bouncer(
251
- config_file=config_file,
252
- create_pr_comment_file=create_pr_comment_file,
253
- only=only,
254
- output_file=output_file,
255
- output_only_failures=output_only_failures,
256
- show_all_failures=show_all_failures,
257
- verbosity=verbosity,
258
- config_file_source=config_file_source,
259
- )
260
- ctx.exit(exit_code)
249
+ if ctx.invoked_subcommand is None:
250
+ config_file_source = ctx.get_parameter_source("config_file").name # type: ignore[union-attr]
251
+ exit_code = run_bouncer(
252
+ config_file=config_file,
253
+ create_pr_comment_file=create_pr_comment_file,
254
+ only=only,
255
+ output_file=output_file,
256
+ output_only_failures=output_only_failures,
257
+ show_all_failures=show_all_failures,
258
+ verbosity=verbosity,
259
+ config_file_source=config_file_source,
260
+ )
261
+ ctx.exit(exit_code)
262
+
263
+
264
+ @cli.command()
265
+ def init() -> None:
266
+ """Create a basic dbt-bouncer.yml file.
267
+
268
+ Raises:
269
+ RuntimeError: If the config file already exists.
270
+
271
+ """
272
+ config_content = """# dbt-bouncer configuration file
273
+ # This file is used to configure dbt-bouncer checks.
274
+
275
+ dbt_artifacts_dir: target # Directory where dbt artifacts (manifest.json, etc.) are located.
276
+
277
+ manifest_checks:
278
+ - name: check_model_description_populated
279
+ description: All models must have a description.
280
+
281
+ - name: check_model_names
282
+ description: Models in the staging layer should always start with "stg_".
283
+ include: ^models/staging
284
+ model_name_pattern: ^stg_
285
+
286
+ - name: check_model_has_unique_test
287
+ description: All models must have a unique test defined.
288
+
289
+ # Example: check that relies on `catalog.json` being present
290
+ # catalog_checks:
291
+ # - name: check_column_description_populated
292
+ # description: All columns in the marts layer must have a description.
293
+ # include: ^models/marts
294
+ """
295
+ configure_console_logging(verbosity=0)
296
+
297
+ config_path = Path("dbt-bouncer.yml")
298
+ if config_path.exists():
299
+ raise RuntimeError(f"{config_path} already exists.")
300
+
301
+ with Path(config_path).open("w") as f:
302
+ f.write(config_content)
303
+
304
+ logging.info(f"Created `{config_path}`.")
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 "2.0.0rc1"
8
+ return "2.1.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dbt-bouncer
3
- Version: 2.0.0rc1
3
+ Version: 2.1.0
4
4
  Summary: Configure and enforce conventions for your dbt project.
5
5
  Author-email: Padraic Slattery <pgoslatara@gmail.com>
6
6
  Maintainer-email: Padraic Slattery <pgoslatara@gmail.com>
@@ -134,17 +134,8 @@ All documentation can be found on `dbt-bouncer` [documentation website](https://
134
134
 
135
135
  1. Create a `dbt-bouncer.yml` config file:
136
136
 
137
- ```yml
138
- manifest_checks:
139
- - name: check_model_directories
140
- include: ^models
141
- permitted_sub_directories:
142
- - intermediate
143
- - marts
144
- - staging
145
- - name: check_model_names
146
- include: ^models/staging
147
- model_name_pattern: ^stg_
137
+ ```shell
138
+ dbt-bouncer init
148
139
  ```
149
140
 
150
141
  1. Run `dbt-bouncer`:
@@ -4,10 +4,10 @@ dbt_bouncer/config_file_parser.py,sha256=iun73dJfaC6n171YihA4pEVM22wngHOIcwXGVC7
4
4
  dbt_bouncer/config_file_validator.py,sha256=oOs4lgflLIMKdARra3Je0MggzF4gEfBRwFWioSn-BNQ,11330
5
5
  dbt_bouncer/global_context.py,sha256=5ct2jjtaTtfgO8vHYCBETaxOoYG4u5lDaBltFn0RJzE,690
6
6
  dbt_bouncer/logger.py,sha256=qkwB-SVUE4YUUp-MtmbcDPUX7t3zdniQL5Linuomr94,1804
7
- dbt_bouncer/main.py,sha256=wQtl3i7QDoo4ymiYrneaRBecDHWSNwSBY7B0GSnT1NU,8694
7
+ dbt_bouncer/main.py,sha256=DYqE9-OQMJ9CQHsTU2kLEHnKaEi7YEpXH5bvYu48EEg,10085
8
8
  dbt_bouncer/runner.py,sha256=1JjMecab6d5UYkWBa4bkw5SWlA0RDb40sbp7YB_9BYw,11650
9
9
  dbt_bouncer/utils.py,sha256=WaqIVRCvuHRqnN3lMd9xtzLGJ-E06gz3Ols6jIZZC5k,12810
10
- dbt_bouncer/version.py,sha256=Xd_u4K-00ASNLNIka953jW8CU5JQazjTBPzuFpHkfQ8,151
10
+ dbt_bouncer/version.py,sha256=6hD5XSTWvrGsnQU-KS-eP1sdAF7xPgFVpWNXnDFzLSU,148
11
11
  dbt_bouncer/artifact_parsers/parsers_catalog.py,sha256=CbW_8IoNX8Son32Z5Ca2aqoyqPLalD6zKokogZOe-6s,3173
12
12
  dbt_bouncer/artifact_parsers/parsers_common.py,sha256=R6CBF8EwpqUZnApLFST3CxSB9eauPaz_oU8bDXU5kCo,7390
13
13
  dbt_bouncer/artifact_parsers/parsers_manifest.py,sha256=79zMP2MhOsaqioc8VxO9vMRJcdY1ALQ_CvWEPO8OpWE,10698
@@ -29,9 +29,9 @@ dbt_bouncer/checks/manifest/check_snapshots.py,sha256=Ke7OdGHLHYquNjiBrw0lMImAcp
29
29
  dbt_bouncer/checks/manifest/check_sources.py,sha256=ZsV3aL10vKX_UM4ip2pAEkGUQdTWJcIVl6hzdXXnT6E,20921
30
30
  dbt_bouncer/checks/manifest/check_unit_tests.py,sha256=I0orkSnueseUHqCQv7pdmzawnxZTwepDzcl8RgS5GXg,10046
31
31
  dbt_bouncer/checks/run_results/check_run_results.py,sha256=WL8neXGyPBhV_znbilVTF57__lXE97kCGB2lSc7931w,4614
32
- dbt_bouncer-2.0.0rc1.dist-info/licenses/LICENSE,sha256=gGXp4VL__ZWlTWhXHRjWJmkxl5X9UJ7L7n1dr2WlfsY,1074
33
- dbt_bouncer-2.0.0rc1.dist-info/METADATA,sha256=MjpYiM-8lhn01ALw2HUQxvMRYX2DsM-vjwDawXWZrtc,5717
34
- dbt_bouncer-2.0.0rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
35
- dbt_bouncer-2.0.0rc1.dist-info/entry_points.txt,sha256=BGHZ6oZsZjq5MUVKYSdbwy80f7cEOCTC-UqqEN1GrBg,53
36
- dbt_bouncer-2.0.0rc1.dist-info/top_level.txt,sha256=TnVuJYP3nH_F7nkc63iXA34kAnwrOWWDpTUyd-GLpR4,12
37
- dbt_bouncer-2.0.0rc1.dist-info/RECORD,,
32
+ dbt_bouncer-2.1.0.dist-info/licenses/LICENSE,sha256=gGXp4VL__ZWlTWhXHRjWJmkxl5X9UJ7L7n1dr2WlfsY,1074
33
+ dbt_bouncer-2.1.0.dist-info/METADATA,sha256=74RetFovgA9LvAFDlYL7G_Q6iis22XUcI8xLkHhZb6c,5456
34
+ dbt_bouncer-2.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
35
+ dbt_bouncer-2.1.0.dist-info/entry_points.txt,sha256=BGHZ6oZsZjq5MUVKYSdbwy80f7cEOCTC-UqqEN1GrBg,53
36
+ dbt_bouncer-2.1.0.dist-info/top_level.txt,sha256=TnVuJYP3nH_F7nkc63iXA34kAnwrOWWDpTUyd-GLpR4,12
37
+ dbt_bouncer-2.1.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5