elementary-data / elementary

The dbt-native data observability solution for data & analytics engineers. Monitor your data pipelines in minutes. Available as self-hosted or cloud service with premium features.
https://www.elementary-data.com/
Apache License 2.0
1.94k stars 165 forks source link

edr --project-dir is not used when edr calls an underlying dbt command #1720

Open michael-c-hoffman opened 1 month ago

michael-c-hoffman commented 1 month ago

Describe the bug When running edr report --project-dir <myprojectdir> when edr runs an underlying dbt command it does not use the supplied project-dir, but instead the project-dir from where edr is installed to.
Is it possible to utilize an existing dbt project when running the edr commands? or does edr require using it's internal dbt installation and configurations?

To Reproduce Steps to reproduce the behavior:

  1. Run edr report with specifying the project-dir option to point to an existing dbt installation
  2. See error
    edr report --project-dir /project/
    024-10-08 19:59:47 — INFO — Running dbt command --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_test_results", "macro_args": {"days_back": 7, "invocations_per_test": 720, "disable_passed_test_metrics": false}} --project-dir /usr/local/python/3.12.6/lib/python3.12/site-packages/elementary/monitor/dbt_project

Expected behavior

edr report --project-dir /project/
024-10-08 19:59:47 — INFO — Running dbt command --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_test_results", "macro_args": {"days_back": 7, "invocations_per_test": 720, "disable_passed_test_metrics": false}} --project-dir /project/

Environment (please complete the following information):

Additional context Add any other context about the problem here.

Would you be willing to contribute a fix for this issue? Let us know if you're willing to contribute so that we'll be able to provide guidance.