dbt-bouncer 2.0.0rc1__tar.gz → 2.1.0__tar.gz

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.
Files changed (42) hide show
  1. {dbt_bouncer-2.0.0rc1/src/dbt_bouncer.egg-info → dbt_bouncer-2.1.0}/PKG-INFO +3 -12
  2. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/README.md +2 -11
  3. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/pyproject.toml +1 -1
  4. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/main.py +57 -13
  5. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/version.py +1 -1
  6. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0/src/dbt_bouncer.egg-info}/PKG-INFO +3 -12
  7. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/LICENSE +0 -0
  8. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/setup.cfg +0 -0
  9. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/__init__.py +0 -0
  10. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/artifact_parsers/dbt_cloud/catalog_latest.py +0 -0
  11. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/artifact_parsers/dbt_cloud/manifest_latest.py +0 -0
  12. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/artifact_parsers/dbt_cloud/run_results_latest.py +0 -0
  13. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/artifact_parsers/parsers_catalog.py +0 -0
  14. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/artifact_parsers/parsers_common.py +0 -0
  15. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/artifact_parsers/parsers_manifest.py +0 -0
  16. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/artifact_parsers/parsers_run_results.py +0 -0
  17. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/check_base.py +0 -0
  18. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/catalog/check_catalog_sources.py +0 -0
  19. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/catalog/check_columns.py +0 -0
  20. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/common.py +0 -0
  21. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/manifest/check_exposures.py +0 -0
  22. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/manifest/check_lineage.py +0 -0
  23. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/manifest/check_macros.py +0 -0
  24. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/manifest/check_metadata.py +0 -0
  25. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/manifest/check_models.py +0 -0
  26. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/manifest/check_seeds.py +0 -0
  27. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/manifest/check_semantic_models.py +0 -0
  28. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/manifest/check_snapshots.py +0 -0
  29. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/manifest/check_sources.py +0 -0
  30. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/manifest/check_unit_tests.py +0 -0
  31. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/checks/run_results/check_run_results.py +0 -0
  32. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/config_file_parser.py +0 -0
  33. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/config_file_validator.py +0 -0
  34. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/global_context.py +0 -0
  35. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/logger.py +0 -0
  36. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/runner.py +0 -0
  37. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer/utils.py +0 -0
  38. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer.egg-info/SOURCES.txt +0 -0
  39. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer.egg-info/dependency_links.txt +0 -0
  40. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer.egg-info/entry_points.txt +0 -0
  41. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer.egg-info/requires.txt +0 -0
  42. {dbt_bouncer-2.0.0rc1 → dbt_bouncer-2.1.0}/src/dbt_bouncer.egg-info/top_level.txt +0 -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`:
@@ -79,17 +79,8 @@ All documentation can be found on `dbt-bouncer` [documentation website](https://
79
79
 
80
80
  1. Create a `dbt-bouncer.yml` config file:
81
81
 
82
- ```yml
83
- manifest_checks:
84
- - name: check_model_directories
85
- include: ^models
86
- permitted_sub_directories:
87
- - intermediate
88
- - marts
89
- - staging
90
- - name: check_model_names
91
- include: ^models/staging
92
- model_name_pattern: ^stg_
82
+ ```shell
83
+ dbt-bouncer init
93
84
  ```
94
85
 
95
86
  1. Run `dbt-bouncer`:
@@ -38,7 +38,7 @@ maintainers = [{name="Padraic Slattery",email="pgoslatara@gmail.com"}]
38
38
  name = "dbt-bouncer"
39
39
  readme = "README.md"
40
40
  requires-python = ">=3.11,<3.15"
41
- version = "2.0.0rc1"
41
+ version = "2.1.0"
42
42
 
43
43
  [project.optional-dependencies]
44
44
  dev = [
@@ -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}`.")
@@ -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`:
File without changes
File without changes