Skip to content

Chapter_02 #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 1 addition & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"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
}
}
Binary file modified data/nyc_parking_violations.db
Binary file not shown.
Binary file modified data/prod_nyc_parking_violations.db
Binary file not shown.
40 changes: 40 additions & 0 deletions logs/dbt.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
09:35:29.606113 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7de3f7c1a170>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7de3f8279690>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7de3f8279600>]}


============================== 09:35:29.624512 | 397f109e-6d61-4b06-aa3b-48d0b385eea5 ==============================
09:35:29.624512 [info ] [MainThread]: Running with dbt=1.6.1
09:35:29.625308 [debug] [MainThread]: running dbt with arguments {'printer_width': '80', 'indirect_selection': 'eager', 'log_cache_events': 'False', 'write_json': 'True', 'partial_parse': 'True', 'cache_selected_only': 'False', 'warn_error': 'None', 'debug': 'False', 'fail_fast': 'False', 'log_path': 'logs', 'profiles_dir': '/home/vscode/.dbt', 'version_check': 'True', 'use_colors': 'True', 'use_experimental_parser': 'False', 'no_print': 'None', 'quiet': 'False', 'log_format': 'default', 'invocation_command': 'dbt init', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptions(include=[], exclude=[])', 'target_path': 'None', 'introspect': 'True', 'send_anonymous_usage_stats': 'True'}
09:35:29.625986 [warn ] [MainThread]: [ConfigFolderDirectory]: Unable to parse dict {'dir': PosixPath('/home/vscode/.dbt')}
09:35:29.626576 [info ] [MainThread]: Creating dbt configuration folder at
09:35:41.629141 [info ] [MainThread]: A project called nyc_parking_violations already exists here.
09:35:41.630297 [debug] [MainThread]: Command `dbt init` succeeded at 09:35:41.630134 after 12.03 seconds
09:35:41.631004 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7de3f7c1a170>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7de3f9f1fc10>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7de3f594d390>]}
09:35:41.631620 [debug] [MainThread]: Flushing usage events
09:36:17.218198 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x723fd248a200>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x723fd2acd5d0>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x723fd2acd570>]}


============================== 09:36:17.223339 | 5c9d39b3-f04d-4dfd-81e8-98c75350d9dd ==============================
09:36:17.223339 [info ] [MainThread]: Running with dbt=1.6.1
09:36:17.224060 [debug] [MainThread]: running dbt with arguments {'printer_width': '80', 'indirect_selection': 'eager', 'write_json': 'True', 'log_cache_events': 'False', 'partial_parse': 'True', 'cache_selected_only': 'False', 'profiles_dir': '/home/vscode/.dbt', 'fail_fast': 'False', 'version_check': 'True', 'log_path': 'logs', 'debug': 'False', 'warn_error': 'None', 'use_colors': 'True', 'use_experimental_parser': 'False', 'no_print': 'None', 'quiet': 'False', 'log_format': 'default', 'static_parser': 'True', 'warn_error_options': 'WarnErrorOptions(include=[], exclude=[])', 'introspect': 'True', 'target_path': 'None', 'invocation_command': 'dbt init', 'send_anonymous_usage_stats': 'True'}
09:36:35.131851 [debug] [MainThread]: Starter project path: /home/vscode/.local/lib/python3.10/site-packages/dbt/include/starter_project
09:36:35.136832 [info ] [MainThread]:
Your new dbt project "nyc_parking_violations" was created!

For more information on how to configure the profiles.yml file,
please consult the dbt documentation here:

https://docs.getdbt.com/docs/configure-your-profile

One more thing:

Need help? Don't hesitate to reach out to us via GitHub issues or on Slack:

https://community.getdbt.com/

Happy modeling!

09:36:35.137834 [info ] [MainThread]: Setting up your profile.
09:36:38.764876 [info ] [MainThread]: No sample profile found for duckdb.
09:36:38.765954 [debug] [MainThread]: Command `dbt init` succeeded at 09:36:38.765799 after 21.55 seconds
09:36:38.766465 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x723fd248a200>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x723fd46e3820>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x723fd01b9420>]}
09:36:38.766979 [debug] [MainThread]: Flushing usage events
1 change: 1 addition & 0 deletions nyc_parking_violations/.user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
id: 1dae92ca-3de8-493b-85d6-0c0a54a16c58
107 changes: 54 additions & 53 deletions run_sql_queries_here.ipynb
Original file line number Diff line number Diff line change
@@ -1,55 +1,56 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import duckdb\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sql_query = '''\n",
"show tables\n",
"'''\n",
"\n",
"with duckdb.connect('data/nyc_parking_violations.db') as con:\n",
" display(con.sql(sql_query).df())"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import duckdb\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"sql_query = '''\n",
"show tables\n",
"'''\n",
"\n",
"with duckdb.connect('data/prod_nyc_parking_violations.db') as con:\n",
" display(con.sql('show tables'))\n",
" display(con.sql(sql_query).df())"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
}
}
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
"nbformat": 4,
"nbformat_minor": 2
}