diff --git a/README.md b/README.md index 6480eaa..c2b1e78 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ dbterd --version dbterd run -ad samples/dbt-constraints -a "test_relationship:(name:foreign_key|c_from:fk_column_name|c_to:pk_column_name)" - # your own sample without commiting to repo + # your own sample without committing to repo dbterd run -ad samples/local -rt model -rt source ``` diff --git a/dbterd/adapters/algos/base.py b/dbterd/adapters/algos/base.py index 7f4b2c2..3af4358 100644 --- a/dbterd/adapters/algos/base.py +++ b/dbterd/adapters/algos/base.py @@ -99,7 +99,7 @@ def get_tables(manifest: Manifest, catalog: Catalog, **kwargs) -> List[Table]: def enrich_tables_from_relationships( tables: List[Table], relationships: List[Ref] ) -> List[Table]: - """Fullfill columns in Table due to `select *` + """Fulfill columns in Table due to `select *` Args: tables (List[Table]): List of Tables @@ -301,7 +301,7 @@ def get_node_exposures_from_metadata(data=[], **kwargs): data (list, optional): Metadata result list. Defaults to []. Returns: - list: List of maping dict {table_name:..., exposure_name=...} + list: List of mapping dict {table_name:..., exposure_name=...} """ exposures = [] for data_item in data: @@ -328,7 +328,7 @@ def get_node_exposures(manifest: Manifest) -> List[Dict[str, str]]: manifest (dict): dbt manifest json Returns: - list: List of maping dict {table_name:..., exposure_name=...} + list: List of mapping dict {table_name:..., exposure_name=...} """ exposures = [] @@ -490,8 +490,8 @@ def get_relationships(manifest: Manifest, **kwargs) -> List[Ref]: return get_unique_refs(refs=refs) -# def get_relationships_by_contraints(manifest: Manifest, **kwargs) -> List[Ref]: -# """Extract relationships from dbt artifacts based on model's configured contraints +# def get_relationships_by_constraints(manifest: Manifest, **kwargs) -> List[Ref]: +# """Extract relationships from dbt artifacts based on model's configured constraints # Args: # manifest (dict): Manifest json diff --git a/dbterd/adapters/algos/test_relationship.py b/dbterd/adapters/algos/test_relationship.py index 7292953..74521b6 100644 --- a/dbterd/adapters/algos/test_relationship.py +++ b/dbterd/adapters/algos/test_relationship.py @@ -87,7 +87,7 @@ def parse( relationships=relationships, tables=tables ) - # Fullfill columns in Tables (due to `select *`) + # Fulfill columns in Tables (due to `select *`) tables = base.enrich_tables_from_relationships( tables=tables, relationships=relationships ) diff --git a/dbterd/adapters/base.py b/dbterd/adapters/base.py index 989296b..5ed6593 100644 --- a/dbterd/adapters/base.py +++ b/dbterd/adapters/base.py @@ -214,7 +214,7 @@ def __set_single_node_selection( Defaults to None. Returns: - dict: Editted kwargs dict + dict: Edited kwargs dict """ if not node_unique_id: return kwargs diff --git a/dbterd/adapters/dbt_cloud/administrative.py b/dbterd/adapters/dbt_cloud/administrative.py index ea7b6f3..df4f610 100644 --- a/dbterd/adapters/dbt_cloud/administrative.py +++ b/dbterd/adapters/dbt_cloud/administrative.py @@ -70,7 +70,7 @@ def download_artifact(self, artifact: str, artifacts_dir: str) -> bool: bool: True is success, False if any errors """ artifact_api_endpoint = getattr(self, f"{artifact}_api_endpoint") - logger.debug(f"Dowloading...[URL: {artifact_api_endpoint}]") + logger.debug(f"Downloading...[URL: {artifact_api_endpoint}]") try: r = requests.get(url=artifact_api_endpoint, headers=self.request_headers) logger.debug(f"Completed [status: {r.status_code}]") diff --git a/dbterd/adapters/dbt_cloud/graphql.py b/dbterd/adapters/dbt_cloud/graphql.py index 2e8fb90..e03ad2c 100644 --- a/dbterd/adapters/dbt_cloud/graphql.py +++ b/dbterd/adapters/dbt_cloud/graphql.py @@ -7,7 +7,7 @@ class GraphQLHelper: """GraphQL Helper class""" def __init__(self, **kwargs) -> None: - """Initilize the required inputs: + """Initialize the required inputs: - Host URL - Bearer Token """ @@ -34,7 +34,7 @@ def query(self, query: str, **variables): query (str): query string Returns: - dict: Query data responsed. None if any exceptions + dict: Query data responses. None if any exceptions """ try: logger.debug( diff --git a/dbterd/adapters/dbt_cloud/query.py b/dbterd/adapters/dbt_cloud/query.py index bb1705a..43f4f22 100644 --- a/dbterd/adapters/dbt_cloud/query.py +++ b/dbterd/adapters/dbt_cloud/query.py @@ -7,7 +7,7 @@ class Query: """ERD Query file helper""" def __init__(self) -> None: - """Initilize the required input: + """Initialize the required input: - Query directory """ self.dir = f"{os.path.dirname(os.path.realpath(__file__))}/include" diff --git a/dbterd/adapters/dbt_core/dbt_invocation.py b/dbterd/adapters/dbt_core/dbt_invocation.py index 260711d..8649097 100644 --- a/dbterd/adapters/dbt_core/dbt_invocation.py +++ b/dbterd/adapters/dbt_core/dbt_invocation.py @@ -52,7 +52,7 @@ def __invoke(self, runner_args: List[str] = []): return r.result def __construct_arguments(self, *args) -> List[str]: - """Enrich the dbt arguements with the based options + """Enrich the dbt arguments with the based options Returns: List[str]: Actual dbt arguments diff --git a/dbterd/adapters/filter.py b/dbterd/adapters/filter.py index 9d3fb3a..ce4b43c 100644 --- a/dbterd/adapters/filter.py +++ b/dbterd/adapters/filter.py @@ -66,7 +66,7 @@ def evaluate_rule(table: Table, rule: str) -> bool: Args: table (Table): Table object to be evaluated - rule (str): Rule defintion + rule (str): Rule definition Returns: bool: True if satisfied all rules diff --git a/dbterd/cli/main.py b/dbterd/cli/main.py index e92ddd2..2a706df 100644 --- a/dbterd/cli/main.py +++ b/dbterd/cli/main.py @@ -13,13 +13,13 @@ # Programmatic invocation class dbterdRunner: - """Support runner for the programatic call""" + """Support runner for the programmatic call""" def __init__(self) -> None: pass def invoke(self, args: List[str]): - """Invoke a command of dbterd programatically + """Invoke a command of dbterd programmatically Args: args (List[str]): dbterd arguments @@ -61,7 +61,7 @@ def dbterd(ctx, **kwargs): def run(ctx, **kwargs): """ Generate ERD file from reading dbt artifact files, - optionally downloading from Administrative API (dbt Cloud) befor hands + optionally downloading from Administrative API (dbt Cloud) before hands """ Executor(ctx).run(**kwargs) diff --git a/dbterd/cli/params.py b/dbterd/cli/params.py index 89c3849..b6242b7 100644 --- a/dbterd/cli/params.py +++ b/dbterd/cli/params.py @@ -117,7 +117,7 @@ def run_params(func): ) @click.option( "--dbt", - help="Flag to indicate the Selecton to follow dbt's one leveraging Programmatic Invocation", + help="Flag to indicate the Selection to follow dbt's one leveraging Programmatic Invocation", is_flag=True, default=False, show_default=True, diff --git a/dbterd/helpers/file.py b/dbterd/helpers/file.py index aadd57d..a362b92 100644 --- a/dbterd/helpers/file.py +++ b/dbterd/helpers/file.py @@ -72,7 +72,7 @@ def supports_long_paths(windll_name="ntdll") -> bool: # pragma: no cover # Eryk Sun says to use `WinDLL('ntdll')` instead of `windll.ntdll` because # of pointer caching in a comment here: # https://stackoverflow.com/a/35097999/11262881 - # I don't know exaclty what he means, but I am inclined to believe him as + # I don't know exactly what he means, but I am inclined to believe him as # he's pretty active on Python windows bugs! else: try: diff --git a/docs/index.md b/docs/index.md index 17fe94e..1ac15cc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -61,7 +61,7 @@ dbterd --version dbterd run -ad samples/dbt-constraints -a "test_relationship:(name:foreign_key|c_from:fk_column_name|c_to:pk_column_name)" - # your own sample without commiting to repo + # your own sample without committing to repo dbterd run -ad samples/local -rt model -rt source ``` diff --git a/docs/nav/guide/cli-references.md b/docs/nav/guide/cli-references.md index fa60971..6b990c6 100644 --- a/docs/nav/guide/cli-references.md +++ b/docs/nav/guide/cli-references.md @@ -63,7 +63,7 @@ Command to generate diagram-as-a-code file ### dbterd run --select (-s) Selection criteria. -> Select all dbt models if not specified, supports mulitple options +> Select all dbt models if not specified, supports multiple options Rules: @@ -102,7 +102,7 @@ Rules: #### `AND` and `OR` logic -- `AND` logic is applied to a single selection splitted by comma (,) +- `AND` logic is applied to a single selection split by comma (,) - `OR` logic is applied to 2+ selection **Examples:** @@ -122,7 +122,7 @@ Rules: ### dbterd run --exclude (-ns) Exclusion criteria. Rules are the same as Selection Criteria. -> Do not exclude any dbt models if not specified, supports mulitple options +> Do not exclude any dbt models if not specified, supports multiple options **Examples:** === "CLI" @@ -226,7 +226,7 @@ In the above: - `c_to`: Configure the test metadata attribute (2) for the referenced column name(s). If (2)'s value is multiple columns, it will concat them all with `_and` wording. Default to `field` !!! tip "For example, if you would use `dbt-constraints` package" - The [dbt-constraints](https://hub.getdbt.com/snowflake-labs/dbt_constraints/latest/) package is using different name of test which is close to the contraint names, in this case, you would need to customize the input string here: + The [dbt-constraints](https://hub.getdbt.com/snowflake-labs/dbt_constraints/latest/) package is using different name of test which is close to the constraint names, in this case, you would need to customize the input string here: ```bash dbterd run \ @@ -300,7 +300,7 @@ Specified dbt catalog.json version ### dbterd run --resource-type (-rt) Specified dbt resource type(seed, model, source, snapshot). -> Default to `["model"]`, supports mulitple options +> Default to `["model"]`, supports multiple options **Examples:** === "CLI" @@ -316,7 +316,7 @@ Specified dbt resource type(seed, model, source, snapshot). ### dbterd run --dbt -Flag to indicate the Selecton to follow dbt's one leveraging Programmatic Invocation +Flag to indicate the Selection to follow dbt's one leveraging Programmatic Invocation > Default to `False` **Examples:** @@ -335,7 +335,7 @@ Flag to indicate the Selecton to follow dbt's one leveraging Programmatic Invoca ### dbterd run --dbt --dbt-auto-artifact -Flag to indicate force running `dbt docs generate` to the targetted project in order to produce the dbt artifact files. +Flag to indicate force running `dbt docs generate` to the targeted project in order to produce the dbt artifact files. This option have to be enabled together with `--dbt` option, and will override the value of `--artifacts-dir` to be using the `/target` dir of the value of `--dbt-project-dir`. diff --git a/docs/nav/guide/dbt-cloud/download-artifact-from-a-job-run.md b/docs/nav/guide/dbt-cloud/download-artifact-from-a-job-run.md index 8efca4c..32fa24a 100644 --- a/docs/nav/guide/dbt-cloud/download-artifact-from-a-job-run.md +++ b/docs/nav/guide/dbt-cloud/download-artifact-from-a-job-run.md @@ -65,7 +65,7 @@ $env:DBTERD_DBT_CLOUD_HOST_URL="your_value" # optional, default = cloud.getdbt.c $env:DBTERD_DBT_CLOUD_API_VERSION="your_value" # optional, default = v2 ``` -## 2. Genrate ERD file +## 2. Generate ERD file We're going to use `--dbt-cloud` option to tell `dbterd` to use dbt Cloud API with all above variables. @@ -83,9 +83,9 @@ and then, here is the sample console log: ```log dbterd - INFO - Run with dbterd==1.0.0 (main.py:54) dbterd - INFO - Using dbt project dir at: C:\Sources\dbterd (base.py:46) -dbterd - INFO - Dowloading...[URL: https://hidden/api/v2/accounts/hidden/runs/hidden/artifacts/manifest.json] (dbt_cloud.py:68) +dbterd - INFO - Downloading...[URL: https://hidden/api/v2/accounts/hidden/runs/hidden/artifacts/manifest.json] (dbt_cloud.py:68) dbterd - INFO - Completed [status: 200] (dbt_cloud.py:71) -dbterd - INFO - Dowloading...[URL: https://hidden/api/v2/accounts/hidden/runs/hidden/artifacts/catalog.json] (dbt_cloud.py:68) +dbterd - INFO - Downloading...[URL: https://hidden/api/v2/accounts/hidden/runs/hidden/artifacts/catalog.json] (dbt_cloud.py:68) dbterd - INFO - Completed [status: 200] (dbt_cloud.py:71) dbterd - INFO - Using dbt artifact dir at: hidden (base.py:73) dbterd - INFO - Collected 4 table(s) and 3 relationship(s) (test_relationship.py:59) diff --git a/docs/nav/guide/dbt-cloud/download-artifact-from-a-job.md b/docs/nav/guide/dbt-cloud/download-artifact-from-a-job.md index d17a021..b063626 100644 --- a/docs/nav/guide/dbt-cloud/download-artifact-from-a-job.md +++ b/docs/nav/guide/dbt-cloud/download-artifact-from-a-job.md @@ -40,9 +40,9 @@ And the sample logs: ```log dbterd - INFO - Run with dbterd==1.0.0 (main.py:54) dbterd - INFO - Using dbt project dir at: C:\Sources\dbterd (base.py:46) -dbterd - INFO - Dowloading...[URL: https://hidden/api/v2/accounts/hidden/jobs/hidden/artifacts/manifest.json] (dbt_cloud.py:68) +dbterd - INFO - Downloading...[URL: https://hidden/api/v2/accounts/hidden/jobs/hidden/artifacts/manifest.json] (dbt_cloud.py:68) dbterd - INFO - Completed [status: 200] (dbt_cloud.py:71) -dbterd - INFO - Dowloading...[URL: https://hidden/api/v2/accounts/hidden/jobs/hidden/artifacts/catalog.json] (dbt_cloud.py:68) +dbterd - INFO - Downloading...[URL: https://hidden/api/v2/accounts/hidden/jobs/hidden/artifacts/catalog.json] (dbt_cloud.py:68) dbterd - INFO - Completed [status: 200] (dbt_cloud.py:71) dbterd - INFO - Using dbt artifact dir at: hidden (base.py:73) dbterd - INFO - Collected 4 table(s) and 3 relationship(s) (test_relationship.py:59) diff --git a/docs/nav/guide/dbt-cloud/read-artifact-from-an-environment.md b/docs/nav/guide/dbt-cloud/read-artifact-from-an-environment.md index 84d6796..c0edb3c 100644 --- a/docs/nav/guide/dbt-cloud/read-artifact-from-an-environment.md +++ b/docs/nav/guide/dbt-cloud/read-artifact-from-an-environment.md @@ -64,7 +64,7 @@ $env:DBTERD_DBT_CLOUD_SERVICE_TOKEN="your_value" $env:DBTERD_DBT_CLOUD_ENVIRONMENT_ID="your_value" ``` -## 2. Genrate ERD file +## 2. Generate ERD file We're going to use a new command as `dbterd run-metadata` to tell `dbterd` to use dbt Cloud Discovery API with all above variables. @@ -74,7 +74,7 @@ The command will be looks like: dbterd run-metadata [-s ] ``` -> Behind the scenes, it will try use to the ERD GraphQL query buit-in at [include/erd_query.gql](https://github.com/datnguye/dbterd/tree/main/dbterd/adapters/dbt_cloud/include/erd_query.gql) +> Behind the scenes, it will try use to the ERD GraphQL query built-in at [include/erd_query.gql](https://github.com/datnguye/dbterd/tree/main/dbterd/adapters/dbt_cloud/include/erd_query.gql) and then, here is the sample console log: diff --git a/docs/nav/guide/targets/generate-d2.md b/docs/nav/guide/targets/generate-d2.md index 559a51d..bced763 100644 --- a/docs/nav/guide/targets/generate-d2.md +++ b/docs/nav/guide/targets/generate-d2.md @@ -27,7 +27,7 @@ curl -fsSL https://d2lang.com/install.sh | sh -s -- -### 3. Embeded into Markdown +### 3. Embedded into Markdown ```markdown # Sample D2 ERD diff --git a/docs/nav/guide/targets/generate-graphviz.md b/docs/nav/guide/targets/generate-graphviz.md index 8c3984c..9fa3528 100644 --- a/docs/nav/guide/targets/generate-graphviz.md +++ b/docs/nav/guide/targets/generate-graphviz.md @@ -23,7 +23,7 @@ sudo apt install graphviz -### 3. Embeded into Markdown +### 3. Embedded into Markdown ```markdown # Sample GraphViz ERD diff --git a/docs/nav/guide/targets/generate-plantuml.md b/docs/nav/guide/targets/generate-plantuml.md index 4eafd3e..72e1f9d 100644 --- a/docs/nav/guide/targets/generate-plantuml.md +++ b/docs/nav/guide/targets/generate-plantuml.md @@ -14,7 +14,7 @@ - Paste the PlantUML content generated as above - Wait for a second and get the URL -### 3. Embeded the PlantUML URL into Markdown +### 3. Embedded the PlantUML URL into Markdown ```markdown ![](https://www.plantuml.com/plantuml/dpng/{your-hash}) diff --git a/docs/nav/metadata/relationship_type.md b/docs/nav/metadata/relationship_type.md index 2c9455f..f954b48 100644 --- a/docs/nav/metadata/relationship_type.md +++ b/docs/nav/metadata/relationship_type.md @@ -21,7 +21,7 @@ Default value: `many-to-one` if the meta config is not specified List of accepted values: -| Relationship Type | Programatic Symbol | +| Relationship Type | Programmatic Symbol | |--------|--------| | one-to-many | 1n | | zero-to-many | 0n | diff --git a/mkdocs.yml b/mkdocs.yml index d2d3ec0..395a0d5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,7 +1,7 @@ site_name: DaaC from dbt artifacts site_url: https://datnguye.github.io/dbterd/ site_author: Dat Nguyen -site_description: Offical documentation of `dbterd` CLI +site_description: Official documentation of `dbterd` CLI repo_name: datnguye/dbterd repo_url: https://github.com/datnguye/dbterd diff --git a/tests/unit/helpers/test_jsonify.py b/tests/unit/helpers/test_jsonify.py index e81c703..e210722 100644 --- a/tests/unit/helpers/test_jsonify.py +++ b/tests/unit/helpers/test_jsonify.py @@ -20,7 +20,7 @@ class DummyData: class TestFile: @pytest.mark.parametrize( - "input, ouput", + "input, output", [ ('{"data":"dummy"}', dict({"data": "dummy"})), ( @@ -29,8 +29,8 @@ class TestFile: ), ], ) - def test_mask(self, input, ouput): - assert jsonify.mask(obj=input) == ouput + def test_mask(self, input, output): + assert jsonify.mask(obj=input) == output def test_mask_with_class(self): obj = Dummy(str="dummy", secret_str="this is a secret")