Skip to content

Commit

Permalink
Minor documentation improvements (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsimsek authored Jul 7, 2024
1 parent a5a7a59 commit 732693a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
The `opendbt` library extends the capabilities of dbt. It unlocks many customizations, allowing you to tailor dbt to
your specific needs and data workflows.

Forexample creating custom transformations by customizing existing adapters
Forexample creating custom transformations by customizing existing adapters.

With `opendbt` you can go beyond the core functionalities of dbt by seamlessly integrating your customized adapter and
provide jinja with further adapter/python methods. Enabling custom python methods tailored to your advanced needs.
provide jinja with further adapter/python methods.

# Sample use cases, examples
# Examples use cases

- Use customised adapter, provide jinja with custom python methods
- Execute Python Model(Python code) Locally
- Enable Model-Level Orchestration Using Airflow
- Create page on Airflow Server to serve DBT docs

please see [examples](docs/EXAMPLES.md).
For more details please see [examples](docs/EXAMPLES.md).

## Installation

Expand All @@ -30,7 +30,7 @@ pip install https://github.com/memiiso/opendbt/archive/master.zip --upgrade --us
install version from github:

```shell
pip install https://github.com/memiiso/opendbt/archive/refs/tags/0.1.0.zip --upgrade --user
pip install https://github.com/memiiso/opendbt/archive/refs/tags/0.2.0.zip --upgrade --user
```

### Contributors
Expand Down
12 changes: 6 additions & 6 deletions docs/EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ When you want to add more methods to existing adapter and make this methods avai
you can use `dbt_custom_adapter` variable and provide your adapter class.

**Step-1:** Extend existing adapter
https://github.com/memiiso/opendbt/blob/ddf0b1bac379aa42961900f35dfc9938b1bc19c4/opendbt/examples.py#L10-L26
https://github.com/memiiso/opendbt/blob/a5a7a598a3e4f04e184b38257578279473d78cfc/opendbt/examples.py#L10-L26

**Step-2:** Edit `dbt_project.yml` file, set `dbt_custom_adapter` variable to the class name of the new adapter.
```yml
Expand All @@ -29,20 +29,20 @@ this is useful for the scenarios where data is imported from external API.

**Step-1:** Extend existing adapter, Add new adapter method which runs given python code.

https://github.com/memiiso/opendbt/blob/ddf0b1bac379aa42961900f35dfc9938b1bc19c4/opendbt/examples.py#L10-L26
https://github.com/memiiso/opendbt/blob/a5a7a598a3e4f04e184b38257578279473d78cfc/opendbt/examples.py#L10-L26

**Step-2:** Create materialization, where from the jonja we call this new adapter method

https://github.com/memiiso/opendbt/blob/ddf0b1bac379aa42961900f35dfc9938b1bc19c4/opendbt/macros/executepython.sql#L1-L26
https://github.com/memiiso/opendbt/blob/a5a7a598a3e4f04e184b38257578279473d78cfc/opendbt/macros/executepython.sql#L1-L26

**Step-3:** Create model using the materialization

https://github.com/memiiso/opendbt/blob/ddf0b1bac379aa42961900f35dfc9938b1bc19c4/tests/resources/dbttest/models/my_executepython_dbt_model.py#L1-L22
https://github.com/memiiso/opendbt/blob/a5a7a598a3e4f04e184b38257578279473d78cfc/tests/resources/dbttest/models/my_executepython_dbt_model.py#L1-L22

## Enable Model-Level Orchestration Using Airflow

**Step-1:** Create Dag to run dbt project
https://github.com/memiiso/opendbt/blob/ddf0b1bac379aa42961900f35dfc9938b1bc19c4/tests/resources/airflow/dags/dbt_workflow.py#L17-L32
https://github.com/memiiso/opendbt/blob/a5a7a598a3e4f04e184b38257578279473d78cfc/tests/resources/airflow/dags/dbt_workflow.py#L17-L32

![airflow-dbt-flow.png](assets%2Fairflow-dbt-flow.png)

Expand Down Expand Up @@ -76,7 +76,7 @@ here is how:
**Step-1:** Create python file under airflow `/{airflow}/plugins` directory, with following code.
Adjust the given path to the folder where dbt docs are published

https://github.com/memiiso/opendbt/blob/154b3e26981d157da70ebb98f1a1576f1fa55832/tests/resources/airflow/plugins/airflow_dbtdocs_page.py#L1-L6
https://github.com/memiiso/opendbt/blob/a5a7a598a3e4f04e184b38257578279473d78cfc/tests/resources/airflow/plugins/airflow_dbtdocs_page.py#L1-L6

**Step-2:** Restart airflow, and check that new link `DBT Docs` is created.
![airflow-dbt-docs-link.png](assets%2Fairflow-dbt-docs-link.png)
Expand Down

0 comments on commit 732693a

Please sign in to comment.