fix(ingest/dbt): only generate one subtype (#10615)

This commit is contained in:
Harshal Sheth 2024-05-29 17:11:34 -07:00 committed by GitHub
parent d78287cc57
commit db965d61ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 39 additions and 97 deletions

View File

@ -45,7 +45,6 @@ from datahub.ingestion.api.incremental_lineage_helper import (
from datahub.ingestion.api.source import MetadataWorkUnitProcessor
from datahub.ingestion.api.source_helpers import auto_workunit
from datahub.ingestion.api.workunit import MetadataWorkUnit
from datahub.ingestion.source.common.subtypes import DatasetSubTypes
from datahub.ingestion.source.dbt.dbt_tests import (
DBTTest,
DBTTestResult,
@ -1739,12 +1738,6 @@ class DBTSourceBase(StatefulIngestionSourceBase):
return None
subtypes: List[str] = [node.node_type.capitalize()]
if node.materialization == "table":
subtypes.append(DatasetSubTypes.TABLE)
if node.node_type == "model" or node.node_type == "snapshot":
# We need to add the view subtype so that the view properties tab shows up in the UI.
subtypes.append(DatasetSubTypes.VIEW)
return MetadataChangeProposalWrapper(
entityUrn=node_datahub_urn,

View File

@ -7,8 +7,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -372,9 +371,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},
@ -606,8 +603,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -943,9 +939,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},

View File

@ -7,8 +7,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -337,9 +336,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},
@ -559,8 +556,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -888,9 +884,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},
@ -1107,8 +1101,7 @@
"aspect": {
"json": {
"typeNames": [
"Snapshot",
"View"
"Snapshot"
]
}
},

View File

@ -7,9 +7,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},
@ -233,9 +231,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},
@ -478,8 +474,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -633,8 +628,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -800,8 +794,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},

View File

@ -7,8 +7,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -337,9 +336,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},
@ -565,7 +562,7 @@
"name": "just-some-random-id_urn:li:dataset:(urn:li:dataPlatform:dbt,pagila.public.an-aliased-view-for-monthly-billing,PROD)",
"type": "BATCH_SCHEDULED",
"created": {
"time": 1643871600000,
"time": 1663355198240,
"actor": "urn:li:corpuser:datahub"
}
}
@ -685,8 +682,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -1020,7 +1016,7 @@
"name": "just-some-random-id_urn:li:dataset:(urn:li:dataPlatform:dbt,pagila.public.an_aliased_view_for_payments,PROD)",
"type": "BATCH_SCHEDULED",
"created": {
"time": 1643871600000,
"time": 1663355198240,
"actor": "urn:li:corpuser:datahub"
}
}
@ -1144,9 +1140,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},
@ -1349,7 +1343,7 @@
"name": "just-some-random-id_urn:li:dataset:(urn:li:dataPlatform:dbt,pagila.public.payments_by_customer_by_month,PROD)",
"type": "BATCH_SCHEDULED",
"created": {
"time": 1643871600000,
"time": 1663355198240,
"actor": "urn:li:corpuser:datahub"
}
}
@ -1468,8 +1462,7 @@
"aspect": {
"json": {
"typeNames": [
"Snapshot",
"View"
"Snapshot"
]
}
},
@ -1873,7 +1866,7 @@
"name": "just-some-random-id_urn:li:dataset:(urn:li:dataPlatform:dbt,pagila.public.customer_snapshot,PROD)",
"type": "BATCH_SCHEDULED",
"created": {
"time": 1643871600000,
"time": 1663355198240,
"actor": "urn:li:corpuser:datahub"
}
}

View File

@ -7,8 +7,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -336,9 +335,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},
@ -552,8 +549,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -889,9 +885,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},

View File

@ -7,8 +7,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -338,9 +337,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},
@ -555,8 +552,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -893,9 +889,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},

View File

@ -7,8 +7,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -337,9 +336,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},
@ -553,8 +550,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -890,9 +886,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},

View File

@ -7,8 +7,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -337,9 +336,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},
@ -553,8 +550,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"View"
"Model"
]
}
},
@ -890,9 +886,7 @@
"aspect": {
"json": {
"typeNames": [
"Model",
"Table",
"View"
"Model"
]
}
},