diff --git a/.vscode/settings.json b/.vscode/settings.json index 236981053..ca20f9585 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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 diff --git a/data/nyc_parking_violations.db b/data/nyc_parking_violations.db index 19e587528..7a63444e1 100644 Binary files a/data/nyc_parking_violations.db and b/data/nyc_parking_violations.db differ diff --git a/data/prod_nyc_parking_violations.db b/data/prod_nyc_parking_violations.db index 9a2bd4ad7..cc541647f 100644 Binary files a/data/prod_nyc_parking_violations.db and b/data/prod_nyc_parking_violations.db differ diff --git a/nyc_parking_violations/dbt_project.yml b/nyc_parking_violations/dbt_project.yml index ec48605d3..e2ce205e5 100644 --- a/nyc_parking_violations/dbt_project.yml +++ b/nyc_parking_violations/dbt_project.yml @@ -49,4 +49,4 @@ models: gold: +materialized: table tests: - +store_failures: true + +store_failures: true # help store failed test diff --git a/nyc_parking_violations/models/bronze/bronze_parking_violation_codes.sql b/nyc_parking_violations/models/bronze/bronze_parking_violation_codes.sql index 217a5f263..e2f7cdc6a 100644 --- a/nyc_parking_violations/models/bronze/bronze_parking_violation_codes.sql +++ b/nyc_parking_violations/models/bronze/bronze_parking_violation_codes.sql @@ -1,7 +1,7 @@ -SELECT - code AS violation_code, - definition, - manhattan_96th_st_below, - all_other_areas -FROM - parking_violation_codes +SELECT + code AS violation_code, + definition, + manhattan_96th_st_below, + all_other_areas +From + parking_violation_codes \ No newline at end of file diff --git a/nyc_parking_violations/models/docs/docs_blocks.md b/nyc_parking_violations/models/docs/docs_block.md similarity index 99% rename from nyc_parking_violations/models/docs/docs_blocks.md rename to nyc_parking_violations/models/docs/docs_block.md index cd410941a..aa403dff5 100644 --- a/nyc_parking_violations/models/docs/docs_blocks.md +++ b/nyc_parking_violations/models/docs/docs_block.md @@ -104,4 +104,4 @@ The total number of tickets issued for a specific violation code. {% docs total_revenue_usd %} The total revenue accumulated from tickets, based on the violation code. This sum is represented in USD. -{% enddocs %} +{% enddocs %} \ No newline at end of file diff --git a/nyc_parking_violations/models/docs/schema.yml b/nyc_parking_violations/models/docs/schema.yml index c1dfcb9fc..0524962a6 100644 --- a/nyc_parking_violations/models/docs/schema.yml +++ b/nyc_parking_violations/models/docs/schema.yml @@ -185,4 +185,4 @@ models: - name: registration_state description: '{{ doc("registration_state") }}' - name: ticket_count - description: '{{ doc("ticket_count") }}' + description: '{{ doc("ticket_count") }}' \ No newline at end of file diff --git a/nyc_parking_violations/models/example/ref_model.sql b/nyc_parking_violations/models/example/ref_model.sql deleted file mode 100644 index 9bb4f51c6..000000000 --- a/nyc_parking_violations/models/example/ref_model.sql +++ /dev/null @@ -1,4 +0,0 @@ -SELECT - COUNT(*) -FROM - {{ref('first_model')}} diff --git a/nyc_parking_violations/models/example/first_model.sql b/nyc_parking_violations/models/examples/first_model.sql similarity index 100% rename from nyc_parking_violations/models/example/first_model.sql rename to nyc_parking_violations/models/examples/first_model.sql diff --git a/nyc_parking_violations/models/examples/ref_model.sql b/nyc_parking_violations/models/examples/ref_model.sql new file mode 100644 index 000000000..57d6efc39 --- /dev/null +++ b/nyc_parking_violations/models/examples/ref_model.sql @@ -0,0 +1,4 @@ +SELECT + COUNT(*) +FROM + {{ref('first_model')}} \ No newline at end of file diff --git a/nyc_parking_violations/profiles.yml b/nyc_parking_violations/profiles.yml index cabe18c54..b63e2b766 100644 --- a/nyc_parking_violations/profiles.yml +++ b/nyc_parking_violations/profiles.yml @@ -1,12 +1,12 @@ -nyc_parking_violations: +nyc_parking_violations: #always remember to name correctly, change from default outputs: dev: type: duckdb - path: '../data/nyc_parking_violations.db' + path: '../data/nyc_parking_violations.db' #always add the path prod: type: duckdb - # note that path is slightly different as GitHub actions + # note that path is slightldbty 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 \ No newline at end of file diff --git a/nyc_parking_violations/seeds/.gitkeep b/nyc_parking_violations/seeds/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/run_sql_queries_here.ipynb b/run_sql_queries_here.ipynb index f7c54e6c9..12dfa1f03 100644 --- a/run_sql_queries_here.ipynb +++ b/run_sql_queries_here.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -12,17 +12,527 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + "
| \n", + " | name | \n", + "
|---|---|
| 0 | \n", + "bronze_parking_violation_codes | \n", + "
| 1 | \n", + "bronze_parking_violations | \n", + "
| 2 | \n", + "first_model | \n", + "
| 3 | \n", + "gold_ticket_metrics | \n", + "
| 4 | \n", + "gold_vehicles_metrics | \n", + "
| 5 | \n", + "parking_violation_codes | \n", + "
| 6 | \n", + "parking_violations_2023 | \n", + "
| 7 | \n", + "ref_model | \n", + "
| 8 | \n", + "silver_parking_violation_codes | \n", + "
| 9 | \n", + "silver_parking_violations | \n", + "
| 10 | \n", + "silver_violation_tickets | \n", + "
| 11 | \n", + "silver_violation_vehicles | \n", + "
| \n", + " | summons_number | \n", + "registration_state | \n", + "plate_type | \n", + "issue_date | \n", + "violation_code | \n", + "vehicle_body_type | \n", + "vehicle_make | \n", + "issuing_agency | \n", + "vehicle_expiration_date | \n", + "violation_location | \n", + "... | \n", + "issuer_precinct | \n", + "issuer_code | \n", + "issuer_command | \n", + "issuer_squad | \n", + "violation_time | \n", + "violation_county | \n", + "violation_legal_code | \n", + "vehicle_color | \n", + "vehicle_year | \n", + "is_manhattan_96th_st_below | \n", + "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", + "9010912681 | \n", + "CA | \n", + "PAS | \n", + "2022-10-11 | \n", + "17 | \n", + "SUBN | \n", + "FORD | \n", + "T | \n", + "20220788 | \n", + "50.0 | \n", + "... | \n", + "50 | \n", + "365910 | \n", + "T201 | \n", + "D | \n", + "0825A | \n", + "BX | \n", + "NaN | \n", + "BLACK | \n", + "0 | \n", + "False | \n", + "
| 1 | \n", + "4858762841 | \n", + "NY | \n", + "PAS | \n", + "2023-08-21 | \n", + "36 | \n", + "4DSD | \n", + "HONDA | \n", + "V | \n", + "0 | \n", + "NaN | \n", + "... | \n", + "0 | \n", + "0 | \n", + "None | \n", + "None | \n", + "1036A | \n", + "BK | \n", + "True | \n", + "GY | \n", + "2003 | \n", + "False | \n", + "
| 2 | \n", + "4854645684 | \n", + "FL | \n", + "PAS | \n", + "2023-07-26 | \n", + "36 | \n", + "UT | \n", + "BMW | \n", + "V | \n", + "0 | \n", + "NaN | \n", + "... | \n", + "0 | \n", + "0 | \n", + "None | \n", + "None | \n", + "0126P | \n", + "QN | \n", + "True | \n", + "WHI | \n", + "2022 | \n", + "False | \n", + "
| 3 | \n", + "9044582707 | \n", + "NY | \n", + "PAS | \n", + "2023-04-10 | \n", + "21 | \n", + "SUBN | \n", + "SUBAR | \n", + "T | \n", + "20231217 | \n", + "79.0 | \n", + "... | \n", + "79 | \n", + "370326 | \n", + "T301 | \n", + "H | \n", + "0924A | \n", + "K | \n", + "NaN | \n", + "GY | \n", + "2017 | \n", + "False | \n", + "
| 4 | \n", + "9041503330 | \n", + "NY | \n", + "PAS | \n", + "2023-03-21 | \n", + "21 | \n", + "4DSD | \n", + "CHEVR | \n", + "T | \n", + "20250320 | \n", + "26.0 | \n", + "... | \n", + "26 | \n", + "373097 | \n", + "T103 | \n", + "C | \n", + "1155A | \n", + "NY | \n", + "NaN | \n", + "BK | \n", + "2018 | \n", + "False | \n", + "
| 5 | \n", + "8964996320 | \n", + "NY | \n", + "COM | \n", + "2023-06-12 | \n", + "21 | \n", + "VAN | \n", + "CHEVR | \n", + "T | \n", + "88888888 | \n", + "46.0 | \n", + "... | \n", + "46 | \n", + "374612 | \n", + "T201 | \n", + "E | \n", + "0923A | \n", + "BX | \n", + "NaN | \n", + "TAN | \n", + "0 | \n", + "False | \n", + "
| 6 | \n", + "9019285804 | \n", + "NY | \n", + "SRF | \n", + "2022-11-20 | \n", + "40 | \n", + "SUBN | \n", + "VOLKS | \n", + "T | \n", + "20240220 | \n", + "20.0 | \n", + "... | \n", + "20 | \n", + "357701 | \n", + "T103 | \n", + "P | \n", + "0230P | \n", + "NY | \n", + "NaN | \n", + "GY | \n", + "2011 | \n", + "False | \n", + "
| 7 | \n", + "9000744076 | \n", + "CT | \n", + "COM | \n", + "2022-07-19 | \n", + "69 | \n", + "SUBN | \n", + "LINCO | \n", + "T | \n", + "88888888 | \n", + "6.0 | \n", + "... | \n", + "6 | \n", + "373104 | \n", + "T102 | \n", + "I | \n", + "0349P | \n", + "NY | \n", + "NaN | \n", + "BLACK | \n", + "0 | \n", + "False | \n", + "
| 8 | \n", + "4839205334 | \n", + "NY | \n", + "PAS | \n", + "2023-04-30 | \n", + "36 | \n", + "SUBN | \n", + "TESLA | \n", + "V | \n", + "0 | \n", + "NaN | \n", + "... | \n", + "0 | \n", + "0 | \n", + "None | \n", + "None | \n", + "1154A | \n", + "BK | \n", + "True | \n", + "RD | \n", + "2021 | \n", + "False | \n", + "
| 9 | \n", + "9006263692 | \n", + "NY | \n", + "PAS | \n", + "2022-09-20 | \n", + "16 | \n", + "SUBN | \n", + "CHEVR | \n", + "T | \n", + "20240323 | \n", + "84.0 | \n", + "... | \n", + "84 | \n", + "368636 | \n", + "T301 | \n", + "P | \n", + "0308P | \n", + "K | \n", + "NaN | \n", + "BK | \n", + "2017 | \n", + "False | \n", + "
10 rows × 21 columns
\n", + "