Skip to content

RatioPBC/ratio-dbt-project

Repository files navigation

Ratio PBC dbt Template

This is a basic repo that will help you get set up to develop a dbt project using the tools we normally use.

Setup steps

  1. Install mise for your operating system
  2. Clone this repo.
  3. Set $MISE_ENV="windows" locally in terminal or globally in environment variable manager if you are on Windows.
  • You may also need to manually run mise activate pwsh | Out-String | Invoke-Expression.
  1. Run mise dr to make sure mise is correctly setup. If you do not get "No problems found", follow the suggested actions until you do.
  2. Run mise install to install tools like Python, uv and duckdb.
  3. Run uv run main.py and you should see "Hello from Ratio!".
  • If this fails, try uv sync or mise activate pwsh | Out-String | Invoke-Expression.
  1. Run dbt --version and you should see dbt version information.
  2. Run mise run db:get
  3. Run dbt debug and you should see "All checks passed!".
  4. Process raw_data/fips.txt into a CSV seed file with fips_code,jurisdiction as the header. It's OK to do this manually.

GitHub Codespace

  1. curl https://mise.run | sh
  2. echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc
  3. Close that terminal and open a new one
  4. Follow along above from the mise dr step.

Raw Data

Interview Hints

  • You are not expected to look at the data before the interview.
  • You will not need to use all of the tables in the raw_* schemas.
  • main is the default schema in DuckDB.
  • duckdb dev.duckdb -ui will open the database both at the command line and in a browser UI.
    • Click "Open In Browser" Screenshot of Codespace "Open In Browser" button
    • See this post for details on the DuckDB UI.
  • If you're curious about the setup steps, you can view the mise tasks in the mise.toml file.

Note

duckdb really only allows a single connection, which can be a bit of a pain. If you have a CLI or UI session open, you will want to close it with .quit first before you run dbt build, et al.

Help

If at any point you need help getting set up, please don't hesitate to ask! You can create an issue and tag @jc00ke on it, or send Jesse an email: jesse@ratiopbc.com.

About

Template dbt project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages