Does anyone have insights where in package element...
# community-support
r
Does anyone have insights where in package elementary profile set as "elementary" is loaded?
r
When I'm running in Docker, it's got it's own dbt project under
Copy code
/usr/local/lib/python3.12/site-packages/elementary/monitor/dbt_project
In my local machine virtual env, it's similar, just that the path starts at /lib instead of /usr You may need to do a dbt-deps from that directory if it's not happening automatically.
r
Challenge is DBT run/test writes to elementary schema and it writes to database where DBTs run. Then how are we supposed to use separate database for elementary?
r
Not sure if that's supported. Separate schema (dataset in BQ) but not sure about database -- are you providing a different database in the elementary output profiles when you run into this? (in your own project profiles.yml)
r
yes, but that elementray profile isn't picked dbt runs with own profile
r
I will let someone from Elementary comment on that, because it seems they must or else they'd be writing to the wrong tables?
r
Thanks @Renee Cooper
n
Hey @Raman Ghadge! Thanks for reaching out Am I understanding correctly you want to specify a different database for the elementary schema? Can you try defining the following in your `dbt_project.yml`:
Copy code
models:
  elementary:
    +database: ...
    +schema: ...
And also specify that database in the
elementary
profile so that
edr
would work against your Elementary schema
r
Hi @Noa Kurman Updated dbt_project.yml Encountered an error: ERROR: Cross-db references not allowed in postgres (dbt database vs elementary database)
n
At what stage are you getting this error?
r
Error is on model run. On-run-start is successful. [0m134628.710246 [debug] [ThreadPool]: SQL status: SELECT 30 in 0.0 seconds [0m134628.718821 [debug] [ThreadPool]: On list_elementary_dev_revenue_elementary: ROLLBACK [0m134629.020164 [debug] [ThreadPool]: On list_elementary_dev_revenue_elementary: Close [0m134629.477343 [debug] [ThreadPool]: SQL status: SELECT 57 in 1.0 seconds [0m134629.484400 [debug] [ThreadPool]: On list_dbt_dev_revenue: ROLLBACK [0m134629.846309 [debug] [ThreadPool]: On list_dbt_dev_revenue: Close [0m134629.869320 [debug] [MainThread]: Connection 'master' was properly closed. [0m134629.869764 [debug] [MainThread]: Connection 'list_elementary_dev_revenue_elementary' was properly closed. [0m134629.870054 [debug] [MainThread]: Connection 'list_dbt_dev_dev_revenue' was properly closed. [0m134629.870405 [info ] [MainThread]: [0m134629.870787 [info ] [MainThread]: Finished running in 0 hours 0 minutes and 6.25 seconds (6.25s). [0m134629.871298 [error] [MainThread]: Encountered an error: ERROR: Cross-db references not allowed in postgres (elementary_dev vs dbt_dev) [0m134629.873962 [debug] [MainThread]: Resource report: {"command_name": "run", "command_wall_clock_time": 6.5973144, "process_user_time": 1.445353, "process_kernel_time": 0.162137, "process_mem_max_rss": "126943232", "command_success": false, "process_in_blocks": "0", "process_out_blocks": "0"} [0m134629.874557 [debug] [MainThread]: Command
dbt run
failed at 134629.874428 after 6.60 seconds [0m134629.874978 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x10299d520>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x1050e4b50>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x105236280>]} [0m134629.875392 [debug] [MainThread]: Flushing usage events
n
Ok so if you look at the dbt community and look for this error seems like this is a real limitation of postgres, there are a couple of suggestions there for workarounds, I wonder if anything will suit you for example like writing a foreign data wrapper