aaronsteers
10/13/2022, 3:29 PMaaronsteers
10/13/2022, 3:29 PMjacob_matson
10/13/2022, 3:31 PMdavid_gasquez
10/14/2022, 2:27 PMdavid_gasquez
10/14/2022, 2:28 PMdavid_gasquez
10/14/2022, 3:53 PMjacob_matson
10/14/2022, 4:34 PMjacob_matson
10/14/2022, 4:35 PMaaronsteers
10/14/2022, 4:36 PMjacob_matson
10/14/2022, 4:40 PMaaronsteers
10/15/2022, 12:49 AMjacob_matson
10/17/2022, 8:28 PMaaronsteers
10/17/2022, 8:29 PMjacob_matson
10/17/2022, 8:30 PMjacob_matson
10/17/2022, 8:30 PMjacob_matson
10/19/2022, 3:24 PMjacob_matson
10/19/2022, 3:24 PMaaronsteers
10/19/2022, 6:38 PMjacob_matson
10/19/2022, 7:14 PMjacob_matson
10/20/2022, 2:35 PMjacob_matson
10/20/2022, 4:28 PMaaronsteers
10/21/2022, 2:29 AMaaronsteers
10/21/2022, 2:30 AMjacob_matson
10/21/2022, 2:35 AMjacob_matson
10/21/2022, 2:38 AMaaronsteers
10/21/2022, 5:00 AMand I think I'm on the books for a demo on the 26th during office hours...Fantastic! And also, I probably should have known this already... 😅 🤦♂️
aaronsteers
10/21/2022, 5:08 AMfor the db browser....hear me out on this - is there a way to pass the dbt-osmosis query to the duckdb cli in the terminal? the duckdb cli is excellent...Possible, surely. 🙂 May be tricky, though, as I do believe the dbt-osmosis is intending to use dbt itself as the abstraction/interface layer so it doesn't need to understand/support
n number of DBs/APIs.
But to the crux of your question, yeah, I think duckdb CLI can keep a center-stage position. I personally have a horrible memory for CLI commands in general, so I always appreciate Meltano commands and VSCode tasks to guide me into that CLI command name I can almost remember but just not quite... 😅jacob_matson
10/21/2022, 5:10 AMjacob_matson
10/21/2022, 5:10 AMjacob_matson
10/21/2022, 5:11 AMmake and it feels wrongaaronsteers
10/21/2022, 5:13 AMmeltano run ... <some stuff here> ... my-tool:my-command <more-commands-here> and also meltano invoke my-tool:my-command <extra-args-if-you-need-them>aaronsteers
10/21/2022, 5:21 AMjacob_matson
10/22/2022, 10:05 PM{
"message": "Runtime Error\n The profile 'meltano' does not have a target named '{{ env_var('MELTANO_ENVIRONMENT', 'dev') }}'. The valid target names for this profile are:\n - dev\n - staging\n - prod\n - parquet",
"data": "Traceback (most recent call last):\n File \"<string>\", line 22, in <module>\n File \"/home/vscode/.local/lib/python3.9/site-packages/dbt_osmosis/core/osmosis.py\", line 244, in _init_\n self.parse_project(init=True)\n File \"/home/vscode/.local/lib/python3.9/site-packages/dbt_osmosis/core/osmosis.py\", line 291, in parse_project\n self.config = RuntimeConfig.from_args(self.args)\n File \"/home/vscode/.local/lib/python3.9/site-packages/dbt/config/runtime.py\", line 228, in from_args\n project, profile = cls.collect_parts(args)\n File \"/home/vscode/.local/lib/python3.9/site-packages/dbt/config/runtime.py\", line 204, in collect_parts\n profile = cls._get_rendered_profile(args, profile_renderer, profile_name)\n File \"/home/vscode/.local/lib/python3.9/site-packages/dbt/config/runtime.py\", line 189, in _get_rendered_profile\n return Profile.render_from_args(args, profile_renderer, profile_name)\n File \"/home/vscode/.local/lib/python3.9/site-packages/dbt/config/profile.py\", line 426, in render_from_args\n return cls.from_raw_profiles(\n File \"/home/vscode/.local/lib/python3.9/site-packages/dbt/config/profile.py\", line 392, in from_raw_profiles\n return cls.from_raw_profile_info(\n File \"/home/vscode/.local/lib/python3.9/site-packages/dbt/config/profile.py\", line 336, in from_raw_profile_info\n target_name, profile_data = cls.render_profile(\n File \"/home/vscode/.local/lib/python3.9/site-packages/dbt/config/profile.py\", line 296, in render_profile\n raw_profile_data = cls._get_profile_data(raw_profile, profile_name, target_name)\n File \"/home/vscode/.local/lib/python3.9/site-packages/dbt/config/profile.py\", line 221, in _get_profile_data\n raise DbtProfileError(msg, result_type=\"invalid_target\")\ndbt.exceptions.DbtProfileError: Runtime Error\n The profile 'meltano' does not have a target named '{{ env_var('MELTANO_ENVIRONMENT', 'dev') }}'. The valid target names for this profile are:\n - dev\n - staging\n - prod\n - parquet\n"
}jacob_matson
10/22/2022, 10:06 PMalexander_butler
10/22/2022, 10:17 PMjacob_matson
10/22/2022, 10:19 PMjacob_matson
10/22/2022, 10:19 PMalexander_butler
10/22/2022, 10:23 PMalexander_butler
10/22/2022, 10:27 PMjacob_matson
10/22/2022, 10:28 PMalexander_butler
10/23/2022, 7:59 PMz3z1ma.vscode-dbt-power-user-osmosis
dbt-osmosis should be version 0.9.7
https://marketplace.visualstudio.com/items?itemName=z3z1ma.vscode-dbt-power-user-osmosis
vscode:extension/z3z1ma.vscode-dbt-power-user-osmosisjacob_matson
10/23/2022, 9:51 PMalexander_butler
10/23/2022, 9:54 PMcurl <http://localhost:8581/health> ?
Also I can clone this (the nba repo) and verify locally right?jacob_matson
10/23/2022, 9:56 PMjacob_matson
10/23/2022, 9:58 PMalexander_butler
10/23/2022, 10:08 PMjacob_matson
10/23/2022, 10:09 PMjacob_matson
10/24/2022, 8:27 PMjacob_matson
10/27/2022, 10:18 PM/workspaces/my_project/transform/profiles/duckdb/
When I try run a query with ctrl+enter, query window opens and starts spinning. Health check of the server fails.
So next I started the server with the following params:
dbt-osmosis server serve --project-dir /workspaces/my_project/transform --profiles_dir /workspaces/my_project/transform/profiles/duckdb --host 127.0.0.1 --port 8581
and the server starts! The health check passes as well.
Then when I go back to my model, and run the sql query, i get Project is not registered. Make a POST request to the /register endpoint first to register a runner
So it looks like when running inside a devcontainer + meltano, it can't find the right parameters to get the runner setup etc.alexander_butler
10/27/2022, 11:50 PM--exit-on-error
or it might be more elucidating to run this while the server is up
dbt-osmosis server register-project --project-dir /workspaces/my_project/transform --profiles_dir /workspaces/my_project/transform/profiles/duckdb
It should look like this screenshot on server init (notice the INFO log message pointing out project registration success)alexander_butler
10/27/2022, 11:53 PMalexander_butler
10/27/2022, 11:56 PMjacob_matson
10/27/2022, 11:56 PMjacob_matson
10/27/2022, 11:57 PMdbt-osmosis server register-project --project-name nbamontecarlo --project-dir /workspaces/nba-monte-carlo/transform --profiles-dir /workspaces/nba-monte-carlo/transform/profiles/duckdb
INFO 🌊 Executing dbt-osmosis main.py:386
--- Logging error ---
Traceback (most recent call last):
File "/home/vscode/.local/lib/python3.9/site-packages/dbt_osmosis/main.py", line 252, in _health_check
resp = requests.get(address)
File "/home/vscode/.local/lib/python3.9/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/home/vscode/.local/lib/python3.9/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/home/vscode/.local/lib/python3.9/site-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/home/vscode/.local/lib/python3.9/site-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/home/vscode/.local/lib/python3.9/site-packages/requests/adapters.py", line 565, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8581): Max retries exceeded with url: /health (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f33f0892040>: Failed to establish a new connection: [Errno 111] Connection refused'))alexander_butler
10/27/2022, 11:58 PMjacob_matson
10/27/2022, 11:58 PMjacob_matson
10/28/2022, 12:00 AMalexander_butler
10/28/2022, 12:05 AMmeltano invoke in front of it 🔥
meltano invoke dbt-osmosis server serve ...jacob_matson
10/28/2022, 12:05 AMjacob_matson
10/28/2022, 12:06 AMjacob_matson
10/28/2022, 12:13 AMjacob_matson
10/28/2022, 12:19 AM{'error': {'code': 3, 'message': "Parsing Error\n Env var required but not provided: main.py:403
'DBT_DUCKDB_PATH'", 'data': {'stack': [], 'node': None, 'msg': "Env var required but not provided:
'DBT_DUCKDB_PATH'"}}}alexander_butler
10/28/2022, 12:20 AMalexander_butler
10/28/2022, 12:21 AMpip_url of the dbt-osmosis yaml
then override the namespace to namespace: dbt_duckdb
lastly copy over your configjacob_matson
10/28/2022, 12:22 AMjacob_matson
10/28/2022, 12:22 AMjacob_matson
10/28/2022, 12:23 AMjacob_matson
10/28/2022, 12:23 AMalexander_butler
10/28/2022, 12:24 AMjacob_matson
10/28/2022, 12:24 AMalexander_butler
10/28/2022, 12:24 AMjacob_matson
10/28/2022, 12:25 AMalexander_butler
10/28/2022, 12:25 AM& backgrounded task)
alternatively technically dbt power user (my version you are using) will start the server automatically but there is just a tiny bit more config required that I plan on simplifying for meltano usersalexander_butler
10/28/2022, 12:26 AMjacob_matson
10/28/2022, 12:26 AMjacob_matson
10/28/2022, 12:26 AMjacob_matson
10/28/2022, 12:27 AMalexander_butler
10/28/2022, 12:27 AMCmd+' on Mac or Control+' on windows/linux with a model open. It compiles jinja ~as you typealexander_butler
10/28/2022, 12:27 AMalexander_butler
10/28/2022, 12:28 AMdbt-osmosis server serve --project-dir /workspaces/my_project/transform --profiles_dir /workspaces/my_project/transform/profiles/duckdb --host 127.0.0.1 --port 8581
just remember to add meltano invoke in front of it, add optionally the --exit-on-error if you want the server to kill itself if registration failsalexander_butler
10/28/2022, 12:28 AMalexander_butler
10/28/2022, 12:29 AMalexander_butler
10/28/2022, 12:30 AMlimit ...jacob_matson
10/28/2022, 12:31 AMjacob_matson
10/28/2022, 12:31 AMjacob_matson
10/28/2022, 12:32 AMalexander_butler
10/28/2022, 12:33 AMjacob_matson
10/28/2022, 12:33 AMjacob_matson
10/28/2022, 12:41 AMalexander_butler
10/28/2022, 12:45 AMalexander_butler
10/28/2022, 12:46 AMalexander_butler
10/28/2022, 12:46 AMjacob_matson
10/28/2022, 12:47 AMjacob_matson
10/28/2022, 12:48 AMjacob_matson
10/28/2022, 12:48 AMalexander_butler
10/28/2022, 12:49 AMalexander_butler
10/28/2022, 12:49 AMso i'm going to put an issue in later and we can figure out how to proceedacknowledged ack
jacob_matson
10/28/2022, 12:50 AMjacob_matson
10/28/2022, 12:50 AMalexander_butler
10/28/2022, 12:50 AMalexander_butler
10/28/2022, 12:50 AM