Mac Fluehr
10/29/2024, 6:12 PMdbt run -s elementary successfully built the required tables in my target schema
• dbt test successfully runs tests and elementary anomaly detection tests
• elementary_test_results has my test results
my dbt_project.yml sets +schema: elementary and the above runs go into the correct schema
When I run edr report, I find that, because the cli is grabbing the nested elementary project dependency within .venv, all of my config is ignored and I end up with an empty report. Is there any way to explicitly point to the dbt_project.yml path?Mac Fluehr
10/29/2024, 6:18 PMLarissa De Moura
10/30/2024, 3:33 PM--project-dirMac Fluehr
10/30/2024, 5:21 PMproject-dir it searches in a recursive fashion. the INFO block in my edr report command tells me it finds:
--project-dir <path-to-my-project>/.venv/lib/python3.12/site-packages/elementary/monitor/dbt_project
when, unless I understand incorrectly, it should look like this:
--project-dir <path-to-my-project>Joost Boonzajer Flaes
10/31/2024, 12:17 PMMac Fluehr
10/31/2024, 5:46 PMMac Fluehr
10/31/2024, 5:48 PMJoost Boonzajer Flaes
11/03/2024, 1:33 PMMac Fluehr
11/04/2024, 4:07 PMMac Fluehr
11/04/2024, 4:12 PMmy_project
models/
tests/
etc
.venv/
lib/
python-3.12/
site_packages/
elementary/
monitor/
dbt_project/
when I run edr, no matter what I specify as project-dir, edr ultimately finds my_project/.venv/lib/python3.12/site-packages/elementary/monitor/dbt_projectMac Fluehr
11/04/2024, 4:13 PM. from cwd my_project, that elementary uses . not some nested pathMac Fluehr
11/04/2024, 4:14 PMJoost Boonzajer Flaes
11/04/2024, 4:18 PMmy_project) in your case. The .venv folder you can install anywhere and you source it to make sure python will use those packages and pythin installation etc.
the dbt_project that you are seeing in the elementary package in your tree is not your dbt project but rather the dbt project elementary uses (elementary uses dbt internally to create models too :))
So generally you shouldn't even have to look at what is inseide the .venv folderMac Fluehr
11/04/2024, 4:28 PMuv is a newer python dependency manager, and it works somewhat more similarly to js dependencies, where your venv/dependencies get created in your project via a pyproject.toml file, which does get version controlled. I'd prefer not to refactor the whole project dependency management just to get elementary edr to point to the right file. the elementary dbt package works with no problems as does our dbt project and CI/CD.
I'm really trying to get edr to not look in the .venv folder. Is there no workaround to get elementary to not "smart search" for some sort of dbt directory? If there were an .edr-ignore file I could set or if I could specify the dbt_project.yml file (instead of a directory) elementary should look at that would resolve it. I think really where I'm stuck is that edr doesn't take project-dir at face value. It seems to just search for a dbt project somewhere in the directory I've specified and it happens to be finding the wrong one, instead of just looking at the directory I inputJoost Boonzajer Flaes
11/04/2024, 4:37 PMMac Fluehr
11/04/2024, 6:29 PMedr report as a result.
One other clue around this might be, in our dbt project I've overrided the generate_schema_name macro. If I reset this macro to be the dbt default, I can get the data that I've build / recorded in the dbt package to show up in the elementary report. If I use our custom, modified schema, elementary does not find the correct schema. I'm assuming this is because elementary is running the package from the .venv which has no knowledge of the modified generate_schema_name macroMac Fluehr
11/04/2024, 6:30 PMJoost Boonzajer Flaes
11/14/2024, 10:32 AMJose Daniel Chacón Bogarín
12/17/2024, 11:40 AMMac Fluehr
12/18/2024, 2:52 PM--project-dir flag still doesn't work, but you might not need itJose Daniel Chacón Bogarín
12/18/2024, 3:41 PM--profiles-dir actually ended up working