Skip to content
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

feat(ingest/looker): update browse paths to align with looker UI #10147

Merged
merged 5 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ class LookerCommonConfig(EnvConfigMixin, PlatformInstanceConfigMixin):
)
explore_browse_pattern: LookerNamingPattern = pydantic.Field(
description=f"Pattern for providing browse paths to explores. {LookerNamingPattern.allowed_docstring()}",
default=LookerNamingPattern(pattern="/{env}/{platform}/{project}/explores"),
default=LookerNamingPattern(pattern="/Explore/{project}/{model}"),
)
view_naming_pattern: LookerViewNamingPattern = Field(
LookerViewNamingPattern(pattern="{project}.view.{name}"),
description=f"Pattern for providing dataset names to views. {LookerViewNamingPattern.allowed_docstring()}",
)
view_browse_pattern: LookerViewNamingPattern = Field(
LookerViewNamingPattern(pattern="/{env}/{platform}/{project}/views"),
LookerViewNamingPattern(pattern="/Develop/{project}/{file_path}"),
description=f"Pattern for providing browse paths to views. {LookerViewNamingPattern.allowed_docstring()}",
)
tag_measures_and_dimensions: bool = Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def _make_chart_metadata_events(

if dashboard and dashboard.folder_path is not None:
browse_path = BrowsePathsClass(
paths=[f"/looker/{dashboard.folder_path}/{dashboard.title}"]
paths=[f"/Folders/{dashboard.folder_path}/{dashboard.title}"]
)
chart_snapshot.aspects.append(browse_path)

Expand Down Expand Up @@ -673,7 +673,7 @@ def _make_dashboard_metadata_events(
dashboard_snapshot.aspects.append(dashboard_info)
if looker_dashboard.folder_path is not None:
browse_path = BrowsePathsClass(
paths=[f"/looker/{looker_dashboard.folder_path}"]
paths=[f"/Folders/{looker_dashboard.folder_path}"]
)
dashboard_snapshot.aspects.append(browse_path)

Expand Down
101 changes: 64 additions & 37 deletions metadata-ingestion/tests/integration/looker/golden_looker_mces.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand All @@ -49,7 +50,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand Down Expand Up @@ -109,7 +111,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand Down Expand Up @@ -145,7 +148,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand Down Expand Up @@ -225,18 +229,19 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
"proposedSnapshot": {
"com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": {
"urn": "urn:li:dataset:(urn:li:dataPlatform:looker,data.explore.my_view,PROD)",
"urn": "urn:li:dataset:(urn:li:dataPlatform:looker,bogus data.explore.my_view,PROD)",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why - the order of mces for "bogus data" and "data" projects has changed.

"aspects": [
{
"com.linkedin.pegasus2avro.common.BrowsePaths": {
"paths": [
"/prod/looker/lkml_samples/explores"
"/Explore/lkml_samples/bogus data"
]
}
},
Expand All @@ -251,7 +256,7 @@
"looker.explore.label": "My Explore View",
"looker.explore.file": "test_source_file.lkml"
},
"externalUrl": "https://looker.company.com/explore/data/my_view",
"externalUrl": "https://looker.company.com/explore/bogus data/my_view",
"name": "My Explore View",
"description": "lorem ipsum",
"tags": []
Expand Down Expand Up @@ -321,12 +326,13 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,data.explore.my_view,PROD)",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,bogus data.explore.my_view,PROD)",
"changeType": "UPSERT",
"aspectName": "subTypes",
"aspect": {
Expand All @@ -338,55 +344,61 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,data.explore.my_view,PROD)",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,bogus data.explore.my_view,PROD)",
"changeType": "UPSERT",
"aspectName": "embed",
"aspect": {
"json": {
"renderUrl": "https://looker.company.com/embed/explore/data/my_view"
"renderUrl": "https://looker.company.com/embed/explore/bogus data/my_view"
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,data.explore.my_view,PROD)",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,bogus data.explore.my_view,PROD)",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": [
{
"id": "Explore"
},
{
"id": "lkml_samples"
},
{
"id": "explores"
"id": "bogus data"
}
]
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
"proposedSnapshot": {
"com.linkedin.pegasus2avro.metadata.snapshot.DatasetSnapshot": {
"urn": "urn:li:dataset:(urn:li:dataPlatform:looker,bogus data.explore.my_view,PROD)",
"urn": "urn:li:dataset:(urn:li:dataPlatform:looker,data.explore.my_view,PROD)",
"aspects": [
{
"com.linkedin.pegasus2avro.common.BrowsePaths": {
"paths": [
"/prod/looker/lkml_samples/explores"
"/Explore/lkml_samples/data"
]
}
},
Expand All @@ -401,7 +413,7 @@
"looker.explore.label": "My Explore View",
"looker.explore.file": "test_source_file.lkml"
},
"externalUrl": "https://looker.company.com/explore/bogus data/my_view",
"externalUrl": "https://looker.company.com/explore/data/my_view",
"name": "My Explore View",
"description": "lorem ipsum",
"tags": []
Expand Down Expand Up @@ -471,12 +483,13 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,bogus data.explore.my_view,PROD)",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,data.explore.my_view,PROD)",
"changeType": "UPSERT",
"aspectName": "subTypes",
"aspect": {
Expand All @@ -488,44 +501,50 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,bogus data.explore.my_view,PROD)",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,data.explore.my_view,PROD)",
"changeType": "UPSERT",
"aspectName": "embed",
"aspect": {
"json": {
"renderUrl": "https://looker.company.com/embed/explore/bogus data/my_view"
"renderUrl": "https://looker.company.com/embed/explore/data/my_view"
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
"entityType": "dataset",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,bogus data.explore.my_view,PROD)",
"entityUrn": "urn:li:dataset:(urn:li:dataPlatform:looker,data.explore.my_view,PROD)",
"changeType": "UPSERT",
"aspectName": "browsePathsV2",
"aspect": {
"json": {
"path": [
{
"id": "Explore"
},
{
"id": "lkml_samples"
},
{
"id": "explores"
"id": "data"
}
]
}
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand All @@ -544,7 +563,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand All @@ -563,7 +583,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand All @@ -582,7 +603,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand All @@ -597,7 +619,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand All @@ -612,7 +635,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand All @@ -627,7 +651,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand All @@ -642,7 +667,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
},
{
Expand All @@ -657,7 +683,8 @@
},
"systemMetadata": {
"lastObserved": 1586847600000,
"runId": "looker-test"
"runId": "looker-test",
"lastRunId": "no-run-id-provided"
}
}
]
Loading
Loading