OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

DBT cloud ingestion add param to specify job id

Open stephanesol opened this issue 3 years ago • 0 comments

Feature Currently the dbt ingestion spec allows users to specify the account and project id. The logic uses this information to pull the latest run that meets this criteria.

      dbtConfigSource:
        dbtCloudAuthToken: 23423423fdfdfgfdgdfdfg
        dbtCloudAccountId: 342342
        dbtCloudProjectId: 234234
        dbtUpdateDescriptions: false

This does not always work because there can be many jobs in a project and not all of them will be configured to generate docs. For example a CI job that runs frequently that does not (and should not) generate docs will always block the dbt ingestor from completing

omd-ingestion  |     return dispatch(args[0].__class__)(*args, **kw)
omd-ingestion  |   File "/usr/local/lib/python3.9/site-packages/metadata/utils/dbt_config.py", line 203, in _
omd-ingestion  |     raise DBTConfigException(f"Error fetching dbt files from DBT Cloud: {exc}")
omd-ingestion  | metadata.utils.dbt_config.DBTConfigException: Error fetching dbt files from DBT Cloud: 404 Client Error: Not Found for url: https://cloud.getdbt.com/api/v2/accounts/342342/runs/113411885/artifacts/catalog.json

The dbt api allows you to also specify a job id that can be used to accuratly target jobs that are known to output docs for ingestion.

image

Describe the task

Modify the dbt ingestion to allow for an optional job_definition_id

      dbtConfigSource:
        dbtCloudAuthToken: 23423423fdfdfgfdgdfdfg
        dbtCloudAccountId: 342342
        dbtCloudProjectId: 234234
        dbtCloudJobId: 233423
        dbtUpdateDescriptions: false

stephanesol avatar Jan 13 '23 18:01 stephanesol