Giter Site home page Giter Site logo

jaffle-shop-classic's Introduction

Important

This repo is no longer actively maintained. It’s been preserved for continuity and free access. The Jaffle Shop has lived a rich life as dbt’s demo project, but has been superseded by two newer repositories: jaffle-shop, the premier demo project for dbt Cloud, and jaffle_shop_duckdb which supports working locally via DuckDB for those without access to a cloud warehouse. You’re welcome to continue using this repo as an open source resource, just know it will not be actively maintained moving forward.

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

Running this project

To get up and running with this project:

  1. Install dbt using these instructions.

  2. Clone this repository.

  3. Change into the jaffle_shop directory from the command line:

$ cd jaffle_shop
  1. Set up a profile called jaffle_shop to connect to a data warehouse by following these instructions. If you have access to a data warehouse, you can use those credentials – we recommend setting your target schema 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.

  2. Ensure your profile is setup correctly from the command line:

$ dbt debug
  1. 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.
$ dbt seed
  1. Run the models:
$ 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.

  1. Test the output of the models:
$ dbt test
  1. Generate documentation for the project:
$ dbt docs generate
  1. View the documentation for the project:
$ dbt docs serve

What is a jaffle?

A jaffle is a toasted sandwich with crimped, sealed edges. Invented in Bondi in 1949, the humble jaffle is an Australian classic. The sealed edges allow jaffle-eaters to enjoy liquid fillings inside the sandwich, which reach temperatures close to the core of the earth during cooking. Often consumed at home after a night out, the most classic filling is tinned spaghetti, while my personal favourite is leftover beef stew with melted cheese.


For more information on dbt:


jaffle-shop-classic's People

Contributors

alexiswo avatar annafil avatar chaerinlee1 avatar clrcrl avatar dataders avatar davinchia avatar gwenwindflower avatar joellabes avatar owlas avatar versusfacit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jaffle-shop-classic's Issues

jaffle_shop on datahub

Hi,
I found you project datahub ingestion here
But i cant find your datahub recipes and how you did the linage in your git repo. Where can I find it?
Thank you

stg_customers fails because `email` is missing

I tried running the new version of the package today and dbt run failed on stg_customer because it seems email is not in the seed data anymore

(dbt-sugar-lJO0x__U-py3.9) ➜  jaffle_shop git:(main) ✗ dbt seed
Running with dbt=0.19.0
Found 5 models, 20 tests, 0 snapshots, 0 analyses, 138 macros, 0 operations, 3 seed files, 0 sources, 0 exposures

10:36:25 | Concurrency: 1 threads (target='postgres')
10:36:25 |
10:36:25 | 1 of 3 START seed file public.raw_customers.......................... [RUN]
* Deprecation Warning: The quote_columns parameter was not set for seeds, so the
default value of False was chosen. The default will change to True in a future
release.

For more information, see:
https://docs.getdbt.com/v0.15/docs/seeds#section-specify-column-quoting
10:36:25 | 1 of 3 OK loaded seed file public.raw_customers...................... [INSERT 100 in 0.17s]
10:36:25 | 2 of 3 START seed file public.raw_orders............................. [RUN]
10:36:25 | 2 of 3 OK loaded seed file public.raw_orders......................... [INSERT 99 in 0.13s]
10:36:25 | 3 of 3 START seed file public.raw_payments........................... [RUN]
10:36:25 | 3 of 3 OK loaded seed file public.raw_payments....................... [INSERT 113 in 0.10s]
10:36:26 |
10:36:26 | Finished running 3 seeds in 0.68s.

Completed successfully

Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3
(dbt-sugar-lJO0x__U-py3.9) ➜  jaffle_shop git:(main) ✗ dbt run
Running with dbt=0.19.0
Found 5 models, 20 tests, 0 snapshots, 0 analyses, 138 macros, 0 operations, 3 seed files, 0 sources, 0 exposures

10:36:30 | Concurrency: 1 threads (target='postgres')
10:36:30 |
10:36:30 | 1 of 5 START view model public.stg_orders............................ [RUN]
10:36:30 | 1 of 5 OK created view model public.stg_orders....................... [CREATE VIEW in 0.10s]
10:36:30 | 2 of 5 START view model public.stg_payments.......................... [RUN]
10:36:30 | 2 of 5 OK created view model public.stg_payments..................... [CREATE VIEW in 0.09s]
10:36:30 | 3 of 5 START view model public.stg_customers......................... [RUN]
10:36:31 | 3 of 5 ERROR creating view model public.stg_customers................ [ERROR in 0.07s]
10:36:31 | 4 of 5 START table model public.orders............................... [RUN]
10:36:31 | 4 of 5 OK created table model public.orders.......................... [SELECT 99 in 0.15s]
10:36:31 | 5 of 5 SKIP relation public.customers................................ [SKIP]
10:36:31 |
10:36:31 | Finished running 3 view models, 2 table models in 0.58s.

Completed with 1 error and 0 warnings:

Database Error in model stg_customers (models/staging/stg_customers.sql)
  column "email" does not exist
  LINE 15:         email
                   ^
  compiled SQL at target/run/jaffle_shop/models/staging/stg_customers.sql

Done. PASS=3 WARN=0 ERROR=1 SKIP=1 TOTAL=5

Should we add an email? Or did we not want to have this field and therefore we should remove it from models?

Happy to help if you want with this depending on that your answer is.

A new Jaffle Shop is coming...

📣 Introducing the New and Improved Jaffle Shop! 🎉

You may have noticed most of the code in this repo hasn't seen an update in 3 years...well, we're excited to announce that we've been working hard on a modern, feature-rich Jaffle Shop project that includes:

🧪 Unit testing
🧱 Semantic Layer
☁️ Cloud CLI support
💬 and more

The Plan

To make it easier for everyone to find and use the latest and greatest Jaffle Shop, we're proposing some changes:

  • Move the legacy jaffle_shop code (this repo) to a new repo named jaffle-shop-classic that will exist as a public archive
  • Merge the new jaffle-shop repo (note the hyphen, conforming to our normal naming system for repos) into this one
  • Rename this repo to jaffle-shop to maintain the aforementioned naming system
  • Ensure smooth redirects throughout the process

This way, you'll have access to both the classic and the new Jaffle Shop, without any broken links. 🔗

Timeline ⏰

We're planning to make these changes by mid April 2024. If you have any concerns or questions about this process, please let us know!

Not running when on Oracle Autonomous Database

Hi Team,

I have setup a user on Oracle Autonomous Database as per the documentation.
I was able to run the "dbt seed" command successfully but when I try to execute "dbt run" I am getting the error "ORA-01031: insufficient privileges" on all models.

Anyone knows why?

Thank you

`analyses` vs `analysis` in `dbt_project.yml`

I'm very confused. So dbt init with my local installation (1.1) will have

 analysis-paths: ["analyses"]

This jaffle_shop project, and in here: https://github.com/dbt-labs/dbt-starter-project/blob/aacb9fc808481e5975e79448940cd6860cf49a22/dbt_project.yml#L15

both have:

 analysis-paths: ["analysis"]

so now I'm confused on whether dbt-starter-project is actually used for dbt init -- it looks like it's always been analysis there -- and where my local dbt init is getting that from. I doubled checked on a new codespace with 1.2, same behavior.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.