Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
Found via `typos --hidden --format brief` and
`codespell -H codespell -L ines,tthe,nore`
  • Loading branch information
kianmeng committed Jun 23, 2024
1 parent 45507e7 commit c7b27fb
Show file tree
Hide file tree
Showing 29 changed files with 181 additions and 181 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
10 changes: 5 additions & 5 deletions dbterd/adapters/algos/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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 = []

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dbterd/adapters/algos/test_relationship.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion dbterd/adapters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dbterd/adapters/dbt_cloud/administrative.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}]")
Expand Down
4 changes: 2 additions & 2 deletions dbterd/adapters/dbt_cloud/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion dbterd/adapters/dbt_cloud/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dbterd/adapters/dbt_core/dbt_invocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dbterd/adapters/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dbterd/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion dbterd/cli/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion dbterd/helpers/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
14 changes: 7 additions & 7 deletions docs/nav/guide/cli-references.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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:**
Expand All @@ -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"
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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"
Expand All @@ -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:**
Expand All @@ -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`.

Expand Down
6 changes: 3 additions & 3 deletions docs/nav/guide/dbt-cloud/download-artifact-from-a-job-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions docs/nav/guide/dbt-cloud/download-artifact-from-a-job.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions docs/nav/guide/dbt-cloud/read-artifact-from-an-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -74,7 +74,7 @@ The command will be looks like:
dbterd run-metadata [-s <dbterd selection>]
```

> 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:

Expand Down
2 changes: 1 addition & 1 deletion docs/nav/guide/targets/generate-d2.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ curl -fsSL https://d2lang.com/install.sh | sh -s --
<span data-ty data-ty-prompt="$ ~/repo>"></span>
</div>

### 3. Embeded into Markdown
### 3. Embedded into Markdown

```markdown
# Sample D2 ERD
Expand Down
2 changes: 1 addition & 1 deletion docs/nav/guide/targets/generate-graphviz.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sudo apt install graphviz
<span data-ty data-ty-prompt="$ ~/repo>"></span>
</div>

### 3. Embeded into Markdown
### 3. Embedded into Markdown

```markdown
# Sample GraphViz ERD
Expand Down
2 changes: 1 addition & 1 deletion docs/nav/guide/targets/generate-plantuml.md
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion docs/nav/metadata/relationship_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
site_name: DaaC from dbt artifacts
site_name: DataC 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
Expand Down
Loading

0 comments on commit c7b27fb

Please sign in to comment.