Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antoinegiraud/dbt_trial_ag
joujou avec un projet test de dbt & les données jaffle_shop
https://github.com/antoinegiraud/dbt_trial_ag
Last synced: 4 days ago
JSON representation
joujou avec un projet test de dbt & les données jaffle_shop
- Host: GitHub
- URL: https://github.com/antoinegiraud/dbt_trial_ag
- Owner: AntoineGiraud
- Created: 2023-08-08T22:40:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-05T06:45:17.000Z (6 months ago)
- Last Synced: 2024-10-30T18:02:53.253Z (3 months ago)
- Size: 78.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Testing dbt project: `jaffle_shop`
`jaffle_shop` is a fictional ecommerce store. This dbt project transforms raw data from an app database into a customers and orders model ready for analytics.
### What is this repo?
What this repo _is_:
- A self-contained playground dbt project, useful for testing out scripts, and communicating some of the core dbt concepts.What this repo _is not_:
- A tutorial — check out the [Getting Started Tutorial](https://docs.getdbt.com/tutorial/setting-up) for that. Notably, this repo contains some anti-patterns to make it self-contained, namely the use of seeds instead of sources.
- A demonstration of best practices — check out the [dbt Learn Demo](https://github.com/dbt-labs/dbt-learn-demo) repo instead. We want to keep this project as simple as possible. As such, we chose not to implement:
- our standard file naming patterns (which make more sense on larger projects, rather than this five-model project)
- a pull request flow
- CI/CD integrations
- A demonstration of using dbt for a high-complex project, or a demo of advanced features (e.g. macros, packages, hooks, operations) — we're just trying to keep things simple here!### What's in this repo?
This repo contains [seeds](https://docs.getdbt.com/docs/building-a-dbt-project/seeds) that includes some (fake) raw data from a fictional app.The raw data consists of customers, orders, and payments, with the following entity-relationship diagram:
![Jaffle Shop ERD](/etc/jaffle_shop_erd.png)
## Running this project (localy)
To get up and running with this project:
1. Install dbt using [these instructions](https://docs.getdbt.com/docs/installation).
2. Clone this repository.
3. Change into the `xxxxx_xxxx` directory from the command line:
```bash
cd xxxxx_xxxx
```4. Set up a profile called `xxxxx_xxxx` to connect to a data warehouse by following [these instructions](https://docs.getdbt.com/docs/configure-your-profile). If you have access to a data warehouse, you can use those credentials – we recommend setting your [target schema](https://docs.getdbt.com/docs/configure-your-profile#section-populating-your-profile) to be a new schema (dbt will create the schema for you, as long as you have the right privileges). If you don't have access to an existing data warehouse, you can also setup a local postgres database and connect to it in your profile.
5. Ensure your profile is setup correctly from the command line:
```bash
dbt debug
```6. Load the CSVs with the demo data set. This materializes the CSVs as tables in your target schema. Note that a typical dbt project **does not require this step** since dbt assumes your raw data is already in your warehouse.
```bash
dbt seed
```7. Run the models:
```bash
dbt run
```> **NOTE:** If this steps fails, it might mean that you need to make small changes to the SQL in the models folder to adjust for the flavor of SQL of your target database. Definitely consider this if you are using a community-contributed adapter.
8. Test the output of the models:
```bash
dbt test
```9. Generate documentation for the project:
```bash
dbt docs generate
```10. View the documentation for the project:
```bash
dbt docs serve
```---
For more information on dbt:
- Read the [introduction to dbt](https://docs.getdbt.com/docs/introduction).
- Read the [dbt viewpoint](https://docs.getdbt.com/docs/about/viewpoint).
- Join the [dbt community](http://community.getdbt.com/).
---