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

fix(ingest/lookml): emit all views with same name and different file path #9279

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2149,11 +2149,11 @@ def get_internal_workunits(self) -> Iterable[MetadataWorkUnit]: # noqa: C901
maybe_looker_view.id.view_name
):
view_connection_mapping = view_connection_map.get(
maybe_looker_view.id.view_name
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we add a comment explaining what we expect the keys of view_connection_map to be?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done.

maybe_looker_view.id.get_urn(self.source_config)
)
if not view_connection_mapping:
view_connection_map[
maybe_looker_view.id.view_name
maybe_looker_view.id.get_urn(self.source_config)
] = (model_name, model.connection)
# first time we are discovering this view
logger.debug(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
connection: "my_connection"

include: "path1/foo.view.lkml"

explore: aliased_explore {
from: my_view
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
connection: "my_connection"
include: "path2/foo.view.lkml"

explore: duplicate_explore {
from: my_view
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
view: my_view {
derived_table: {
sql:
SELECT
is_latest,
country,
city,
timestamp,
measurement
FROM
my_table ;;
}

dimension: country {
type: string
description: "The country"
sql: ${TABLE}.country ;;
}

dimension: city {
type: string
description: "City"
sql: ${TABLE}.city ;;
}

dimension: is_latest {
type: yesno
description: "Is latest data"
sql: ${TABLE}.is_latest ;;
}

dimension_group: timestamp {
group_label: "Timestamp"
type: time
description: "Timestamp of measurement"
sql: ${TABLE}.timestamp ;;
timeframes: [hour, date, week, day_of_week]
}

measure: average_measurement {
group_label: "Measurement"
type: average
description: "My measurement"
sql: ${TABLE}.measurement ;;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
view: my_view {
derived_table: {
sql:
SELECT
is_latest,
country,
city,
timestamp,
measurement
FROM
my_table ;;
}

dimension: city {
type: string
description: "City"
sql: ${TABLE}.city ;;
}

dimension: is_latest {
type: yesno
description: "Is latest data"
sql: ${TABLE}.is_latest ;;
}

dimension_group: timestamp {
group_label: "Timestamp"
type: time
description: "Timestamp of measurement"
sql: ${TABLE}.timestamp ;;
timeframes: [hour, date, week, day_of_week]
}

measure: average_measurement {
group_label: "Measurement"
type: average
description: "My measurement"
sql: ${TABLE}.measurement ;;
}

}