Skip to content
Open

Main #78

Show file tree
Hide file tree
Changes from all 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
38 changes: 38 additions & 0 deletions .github/workflows/run-dbt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# .github/workflows/run-dbt.yml
name: run-dbt

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# schedule:
# - cron: '0 8 * * *'

env:
DBT_PROFILES_DIR: ./nyc_parking_violations
DBT_PROJECT_DIR: ./nyc_parking_violations

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run dbt Prod
run: |
dbt debug
dbt compile --target prod
dbt run --target prod
- name: Test dbt Prod
run: |
dbt test --target prod
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
Binary file modified data/nyc_parking_violations.db
Binary file not shown.
2 changes: 1 addition & 1 deletion nyc_parking_violations/tests/generic/generic_not_null.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- source: https://docs.getdbt.com/guides/best-practices/writing-custom-generic-tests#generic-tests-with-default-config-values
-- source: https://docs.getdbt.com/guides/bedbt st-practices/writing-custom-generic-tests#generic-tests-with-default-config-values
{% test generic_not_null(model, column_name) %}

select *
Expand Down
11 changes: 11 additions & 0 deletions nyc_parking_violations/tests/viplations_codes_revenue.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ config(severity = 'warn') }}

SELECT
violation_code,
SUM(fee_usd) AS total_revenue_usd
FROM
{{ref('silver_parking_violation_codes')}}
GROUP BY
violation_code
HAVING
NOT(total_revenue_usd >= 1)
2 changes: 1 addition & 1 deletion run_sql_queries_here.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"outputs": [],
"source": [
"sql_query = '''\n",
"show tables\n",
"select * from \"nyc_parking_violations\".\"main_dbt_test__audit\".\"viplations_codes_revenue\"\n",
"'''\n",
"\n",
"with duckdb.connect('data/nyc_parking_violations.db') as con:\n",
Expand Down