Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/run-dbt-prd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# .github/workflows/run-dbt-prd.yml
name: run_dbt_prd

on:
push:
branches:
- main
pull_request:
branches:
- main
env:
DBT_PROFILES_DIR: ./nyc_parking_violations
DBT_PROJECT_DIR: ./nyc_parking_violations

jobs:
dbt_setup:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install dependencies
run: pip install -r requirements.txt

- name: Check dbt version
run: |
dbt --version
dbt debug
dbt --help
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"files.autoSave": "afterDelay",
"screencastMode.onlyKeyboardShortcuts": true,
"terminal.integrated.fontSize": 18,
"workbench.activityBar.visible": true,
"workbench.colorTheme": "Visual Studio Dark",
"workbench.fontAliasing": "antialiased",
"workbench.statusBar.visible": true
Expand Down
2 changes: 1 addition & 1 deletion nyc_parking_violations/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ nyc_parking_violations:
# note that path is slightly different as GitHub actions
# start in the root directory and not in the
# nyc_parking_violations directory
path: './data/prod_nyc_parking_violations.db'
path: '../data/prod_nyc_parking_violations.db'
target: dev
109 changes: 101 additions & 8 deletions run_sql_queries_here.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -14,10 +14,108 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>name</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>bronze_parking_violation_codes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>bronze_parking_violations</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>first_model</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>gold_ticket_metrics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>gold_vehicles_metrics</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
" <td>parking_violation_codes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>parking_violations_2023</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
" <td>ref_model</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>silver_parking_violation_codes</td>\n",
" </tr>\n",
" <tr>\n",
" <th>9</th>\n",
" <td>silver_parking_violations</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <td>silver_violation_tickets</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>silver_violation_vehicles</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" name\n",
"0 bronze_parking_violation_codes\n",
"1 bronze_parking_violations\n",
"2 first_model\n",
"3 gold_ticket_metrics\n",
"4 gold_vehicles_metrics\n",
"5 parking_violation_codes\n",
"6 parking_violations_2023\n",
"7 ref_model\n",
"8 silver_parking_violation_codes\n",
"9 silver_parking_violations\n",
"10 silver_violation_tickets\n",
"11 silver_violation_vehicles"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"sql_query = '''\n",
"show tables\n",
"\n",
"'''\n",
"\n",
"with duckdb.connect('data/nyc_parking_violations.db') as con:\n",
Expand All @@ -43,12 +141,7 @@
"pygments_lexer": "ipython3",
"version": "3.10.12"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
}
}
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
Expand Down