data-mie / dbt-profiler

Macros for generating dbt model data profiles
Apache License 2.0
81 stars 33 forks source link

Catch-22 with docblock in schema file #71

Closed ian-lewis-d closed 1 year ago

ian-lewis-d commented 1 year ago

I have added the suggested docblock to my schema file.

eg:

    tables:
      - name: admin_activity
        description: |
          Admin Activity logging [UNUSED]

          `dbt-profiler` results:

          {{ doc("dbt_profiler_results__test_admin_activity") }}

However, when I try to generate the doc.md files I get the following error:

Documentation for 'source.dbt_test_schema.test.admin_activity' depends on doc 'dbt_profiler_results__test_admin_activity' which was not found

I'm using the update-relation-profile.sh script which works nicely.

It looks like there is no way the generate the markdown files if the docblock is in the YAML schema file.

stumelius commented 1 year ago

@ian-lewis-d Thanks for raising this issue and sorry for the late reply. I can't think of anything else than adding empty docblocks to the project before you run the update-relation-profile.sh script. Did you manage to solve this?

dbeatty10 commented 1 year ago

Here's a write-up what I suspect is happening and how I solved it: https://github.com/dbt-labs/dbt-core/issues/7464#issuecomment-1728277284

Recommendation

I'd recommend adding a little bit of documentation to the README within https://github.com/data-mie/dbt-profiler that adds the relevant instructions related to adding the "docs" folder explicitly to dbt_project.yml either via docs-paths or model-paths.

stumelius commented 1 year ago

@dbeatty10 Thanks for doing the research and the recommendation! Would you like to contribute by writing the instructions in the README and open a PR? :)

dbeatty10 commented 1 year ago

@dbeatty10 Thanks for doing the research and the recommendation! Would you like to contribute by writing the instructions in the README and open a PR? :)

👍 https://github.com/data-mie/dbt-profiler/pull/82