Skip to content

fix(ingestion): use default generate_browse_path_v2 even if no pipeline_config #13117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions metadata-ingestion/src/datahub/ingestion/api/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,9 @@ def get_workunit_processors(self) -> List[Optional[MetadataWorkUnitProcessor]]:
Run in order, first in list is applied first. Be careful with order when overriding.
"""
browse_path_processor: Optional[MetadataWorkUnitProcessor] = None
if (
self.ctx.pipeline_config
and self.ctx.pipeline_config.flags.generate_browse_path_v2
):
if self.ctx.flags.generate_browse_path_v2:
browse_path_processor = self._get_browse_path_processor(
self.ctx.pipeline_config.flags.generate_browse_path_v2_dry_run
self.ctx.flags.generate_browse_path_v2_dry_run
)

auto_lowercase_dataset_urns: Optional[MetadataWorkUnitProcessor] = None
Expand Down
60 changes: 53 additions & 7 deletions metadata-ingestion/tests/unit/glue/glue_delta_mces_golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402207,
"lastObserved": 1744091634014,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand All @@ -35,7 +35,7 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402207,
"lastObserved": 1744091634014,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand All @@ -52,7 +52,7 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402207,
"lastObserved": 1744091634014,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand All @@ -70,7 +70,28 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402207,
"lastObserved": 1744091634014,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "container",
"entityUrn": "urn:li:container:275c7ea5ecf956fd8d45e14228757a8a",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": [
{
"id": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:glue,delta_platform_instance)",
"urn": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:glue,delta_platform_instance)"
}
]
}
},
"systemMetadata": {
"lastObserved": 1744091634014,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand Down Expand Up @@ -1543,7 +1564,7 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402228,
"lastObserved": 1744091634026,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand All @@ -1561,7 +1582,7 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402228,
"lastObserved": 1744091634026,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand All @@ -1577,7 +1598,32 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402228,
"lastObserved": 1744091634026,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:glue,delta_platform_instance.delta-database.delta_table_1,PROD)",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": [
{
"id": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:glue,delta_platform_instance)",
"urn": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:glue,delta_platform_instance)"
},
{
"id": "urn:li:container:275c7ea5ecf956fd8d45e14228757a8a",
"urn": "urn:li:container:275c7ea5ecf956fd8d45e14228757a8a"
}
]
}
},
"systemMetadata": {
"lastObserved": 1744091634027,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402490,
"lastObserved": 1744091635205,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand All @@ -35,7 +35,7 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402490,
"lastObserved": 1744091635205,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand All @@ -52,7 +52,7 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402491,
"lastObserved": 1744091635205,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand All @@ -70,7 +70,28 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402491,
"lastObserved": 1744091635205,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "container",
"entityUrn": "urn:li:container:275c7ea5ecf956fd8d45e14228757a8a",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": [
{
"id": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:glue,delta_platform_instance)",
"urn": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:glue,delta_platform_instance)"
}
]
}
},
"systemMetadata": {
"lastObserved": 1744091635205,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand Down Expand Up @@ -123,7 +144,7 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402491,
"lastObserved": 1744091635206,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand All @@ -141,7 +162,7 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402491,
"lastObserved": 1744091635206,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand All @@ -157,7 +178,32 @@
}
},
"systemMetadata": {
"lastObserved": 1743454402491,
"lastObserved": 1744091635206,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:glue,delta_platform_instance.delta-database.delta_table_1,PROD)",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": [
{
"id": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:glue,delta_platform_instance)",
"urn": "urn:li:dataPlatformInstance:(urn:li:dataPlatform:glue,delta_platform_instance)"
},
{
"id": "urn:li:container:275c7ea5ecf956fd8d45e14228757a8a",
"urn": "urn:li:container:275c7ea5ecf956fd8d45e14228757a8a"
}
]
}
},
"systemMetadata": {
"lastObserved": 1744091635206,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
Expand Down
111 changes: 111 additions & 0 deletions metadata-ingestion/tests/unit/glue/glue_mces_golden.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "container",
"entityUrn": "urn:li:container:0b9f1f731ecf6743be6207fec3dc9cba",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": []
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "container",
"entityUrn": "urn:li:container:bdf4342ea6899d162eae685bfe9074a7",
Expand Down Expand Up @@ -150,6 +166,22 @@
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "container",
"entityUrn": "urn:li:container:bdf4342ea6899d162eae685bfe9074a7",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": []
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "container",
"entityUrn": "urn:li:container:110bc08849d1c1bde5fc345dab5c3ae7",
Expand Down Expand Up @@ -224,6 +256,22 @@
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "container",
"entityUrn": "urn:li:container:110bc08849d1c1bde5fc345dab5c3ae7",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": []
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
},
{
"proposedSnapshot": {
"com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": {
Expand Down Expand Up @@ -467,6 +515,27 @@
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:glue,flights-database.avro,PROD)",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": [
{
"id": "urn:li:container:0b9f1f731ecf6743be6207fec3dc9cba",
"urn": "urn:li:container:0b9f1f731ecf6743be6207fec3dc9cba"
}
]
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
},
{
"proposedSnapshot": {
"com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": {
Expand Down Expand Up @@ -667,6 +736,27 @@
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:glue,test-database.test_jsons_markers,PROD)",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": [
{
"id": "urn:li:container:bdf4342ea6899d162eae685bfe9074a7",
"urn": "urn:li:container:bdf4342ea6899d162eae685bfe9074a7"
}
]
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
},
{
"proposedSnapshot": {
"com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": {
Expand Down Expand Up @@ -868,6 +958,27 @@
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:glue,test-database.test_parquet,PROD)",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": [
{
"id": "urn:li:container:bdf4342ea6899d162eae685bfe9074a7",
"urn": "urn:li:container:bdf4342ea6899d162eae685bfe9074a7"
}
]
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "glue-source-tes",
"lastRunId": "no-run-id-provided"
}
},
{
"proposedSnapshot": {
"com.linkedin.pegasus2avro.metadata.snapshot.DataFlowSnapshot": {
Expand Down
Loading
Loading