fix(ingest/dbt): improve dbt-cloud error message (#14098)

This commit is contained in:
Harshal Sheth 2025-07-15 15:42:14 -07:00 committed by GitHub
parent f12f8e37d0
commit 9de61bd881
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View File

@ -230,9 +230,10 @@ class SourceReport(ExamplesReport):
context: Optional[str] = None,
title: Optional[LiteralString] = None,
exc: Optional[BaseException] = None,
log: bool = True,
) -> None:
self._structured_logs.report_log(
StructuredLogLevel.WARN, message, title, context, exc, log=True
StructuredLogLevel.WARN, message, title, context, exc, log=log
)
def report_failure(

View File

@ -26,6 +26,7 @@ from datahub.ingestion.source.dbt.dbt_common import (
DBTCommonConfig,
DBTNode,
DBTSourceBase,
DBTSourceReport,
)
from datahub.ingestion.source.dbt.dbt_tests import DBTTest, DBTTestResult
@ -266,6 +267,7 @@ query DatahubMetadataQuery_{type}($jobId: BigInt!, $runId: BigInt) {{
@capability(SourceCapability.TEST_CONNECTION, "Enabled by default")
class DBTCloudSource(DBTSourceBase, TestableSource):
config: DBTCloudConfig
report: DBTSourceReport # nothing cloud-specific in the report
@classmethod
def create(cls, config_dict, ctx):
@ -404,8 +406,11 @@ class DBTCloudSource(DBTSourceBase, TestableSource):
if node["resourceType"] in {"model", "seed", "snapshot"}:
status = node["status"]
if status is None and materialization != "ephemeral":
self.report.report_warning(
key, "node is missing a status, schema metadata will be incomplete"
self.report.warning(
title="Schema information may be incomplete",
message="Some nodes are missing the `status` field, which dbt uses to track the status of the node in the target database.",
context=key,
log=False,
)
# The code fields are new in dbt 1.3, and replace the sql ones.