mozilla / lookml-generator

LookML Generator for Glean and Mozilla Data
https://mozilla.github.io/lookml-generator/generator.html
Mozilla Public License 2.0
17 stars 17 forks source link

Add shared_private namespace for country customizations #1079

Closed scholtzan closed 1 month ago

scholtzan commented 1 month ago

This is to fix https://mozilla.slack.com/archives/C01E8GDG80N/p1728324080900889

Currently, there are conflicting namespaces as shared already exists in spoke-default. The naming convention for private namespaces is to add a _private suffix. This will also resolve the conflict here.

dataops-ci-bot commented 1 month ago

Integration report for "Add shared_private namespace for country customizations"

lookml.diff

Click to expand! ```diff Only in /tmp/workspace/looker-hub/firefox_ios: dashboards Only in /tmp/workspace/generated-lookml/: shared_private Only in /tmp/workspace/looker-hub/: user_journey diff -x '.*' -bur --no-dereference --new-file /tmp/workspace/looker-hub/namespaces.yaml /tmp/workspace/generated-lookml/namespaces.yaml --- /tmp/workspace/looker-hub/namespaces.yaml 2024-10-07 18:26:25.255768853 +0000 +++ /tmp/workspace/generated-lookml/namespaces.yaml 2024-10-07 18:26:25.187768651 +0000 @@ -6326,7 +6326,6 @@ shared: glean_app: false owners: - - anicholson@mozilla.com - ascholtz@mozilla.com pretty_name: Shared spoke: looker-spoke-default @@ -6343,6 +6342,17 @@ tables: - table: mozdata.static.data_incidents_v1 type: table_view +shared_private: + glean_app: false + owners: + - ascholtz@mozilla.com + pretty_name: Shared Private + spoke: looker-spoke-default + views: + countries: + tables: + - table: mozdata.static.country_codes_v1 + type: table_view subscription_platform: explores: active_subscriptions: diff -x '.*' -bur --no-dereference --new-file /tmp/workspace/looker-hub/shared_private/datagroups/country_codes_v1_last_updated.datagroup.lkml /tmp/workspace/generated-lookml/shared_private/datagroups/country_codes_v1_last_updated.datagroup.lkml --- /tmp/workspace/looker-hub/shared_private/datagroups/country_codes_v1_last_updated.datagroup.lkml 1970-01-01 00:00:00.000000000 +0000 +++ /tmp/workspace/generated-lookml/shared_private/datagroups/country_codes_v1_last_updated.datagroup.lkml 2024-10-07 18:24:34.000000000 +0000 @@ -0,0 +1,16 @@ +# *Do not manually modify this file* + +# This file has been generated via https://github.com/mozilla/lookml-generator + +# Using a datagroup in an Explore: https://cloud.google.com/looker/docs/reference/param-explore-persist-with +# Using a datagroup in a derived table: https://cloud.google.com/looker/docs/reference/param-view-datagroup-trigger + +datagroup: country_codes_v1_last_updated { + label: "Country Codes V1 Last Updated" + sql_trigger: SELECT MAX(storage_last_modified_time) + FROM `mozdata`.`region-us`.INFORMATION_SCHEMA.TABLE_STORAGE + WHERE table_schema = 'static' + AND table_name = 'country_codes_v1' ;; + description: "Updates when mozdata.static.country_codes_v1 is modified." + max_cache_age: "24 hours" +} \ No newline at end of file diff -x '.*' -bur --no-dereference --new-file /tmp/workspace/looker-hub/shared_private/views/countries.view.lkml /tmp/workspace/generated-lookml/shared_private/views/countries.view.lkml --- /tmp/workspace/looker-hub/shared_private/views/countries.view.lkml 1970-01-01 00:00:00.000000000 +0000 +++ /tmp/workspace/generated-lookml/shared_private/views/countries.view.lkml 2024-10-07 18:23:17.000000000 +0000 @@ -0,0 +1,63 @@ + +# *Do not manually modify this file* +# +# This file has been generated via https://github.com/mozilla/lookml-generator +# You can extend this view in the looker-spoke-default project (https://github.com/mozilla/looker-spoke-default) + +view: countries { + dimension: ads_value_tier { + sql: ${TABLE}.ads_value_tier ;; + type: string + description: "Lowercase label detailing the monetary value tier that Mozilla Ads assign to that region based on market size and our existing products, e.g., tier 1, tier 2, etc." + } + + dimension: code { + sql: ${TABLE}.code ;; + type: string + description: "ISO 3166 alpha-2 country code" + } + + dimension: code_3 { + sql: ${TABLE}.code_3 ;; + type: string + description: "ISO 3166 alpha-3 country code" + } + + dimension: mozilla_vpn_available { + sql: ${TABLE}.mozilla_vpn_available ;; + type: yesno + description: "Whether Mozilla VPN is available in this country." + } + + dimension: name { + sql: ${TABLE}.name ;; + type: string + description: "Official country name per ISO 3166" + } + + dimension: pocket_available_on_newtab { + sql: ${TABLE}.pocket_available_on_newtab ;; + type: yesno + description: "Whether Pocket is available on the newtab page in this country. Note that Pocket might only be available in certain locales/languages within a country." + } + + dimension: region_name { + sql: ${TABLE}.region_name ;; + type: string + description: "Region name. These are based on the UN Statistics Division standard country or area codes for statistical use (M49), but with the \"Americas\" region split into \"North America\" and \"South America\"." + } + + dimension: sponsored_tiles_available_on_newtab { + sql: ${TABLE}.sponsored_tiles_available_on_newtab ;; + type: yesno + description: "Whether sponsored tiles are available on the newtab page in this country. Note that Pocket might only be available in certain locales/languages within a country." + } + + dimension: subregion_name { + sql: ${TABLE}.subregion_name ;; + type: string + description: "Sub-region name. These are based on UN Statistics Division standard country or area codes for statistical use (M49), but with the \"Latin America and the Caribbean\" and \"Sub-Saharan Africa\" sub-regions split into more specific sub-regions." + } + + sql_table_name: `mozdata.static.country_codes_v1` ;; +} \ No newline at end of file diff -x '.*' -bur --no-dereference --new-file /tmp/workspace/looker-hub/user_journey/views/events_daily.view.lkml /tmp/workspace/generated-lookml/user_journey/views/events_daily.view.lkml --- /tmp/workspace/looker-hub/user_journey/views/events_daily.view.lkml 2024-10-07 18:26:25.027768175 +0000 +++ /tmp/workspace/generated-lookml/user_journey/views/events_daily.view.lkml 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -view: events_daily { - sql_table_name: `mozdata.messaging_system.events_daily` - ;; - - dimension: addon_version { - type: string - sql: ${TABLE}.addon_version ;; - } - - dimension: app_version { - type: string - sql: ${TABLE}.app_version ;; - } - - dimension: city { - type: string - sql: ${TABLE}.city ;; - } - - dimension: client_id { - type: string - sql: ${TABLE}.client_id ;; - } - - dimension: country { - type: string - map_layer_name: countries - sql: ${TABLE}.country ;; - } - - dimension: events { - type: string - sql: ${TABLE}.events ;; - hidden: yes - } - - dimension: experiments { - hidden: yes - sql: ${TABLE}.experiments ;; - } - - dimension: locale { - type: string - sql: ${TABLE}.locale ;; - } - - dimension: normalized_channel { - type: string - sql: ${TABLE}.normalized_channel ;; - } - - dimension: os { - type: string - sql: ${TABLE}.os ;; - } - - dimension: sample_id { - type: number - sql: ${TABLE}.sample_id ;; - } - - dimension: subdivision1 { - type: string - sql: ${TABLE}.subdivision1 ;; - } - - dimension: submission_date { - type: date - sql: CAST(${TABLE}.submission_date AS TIMESTAMP) ;; - } -} ```

Link to full diff

dataops-ci-bot commented 1 month ago

Integration report for "Update custom-namespaces.yaml"

lookml.diff

Click to expand! ```diff Only in /tmp/workspace/looker-hub/firefox_ios: dashboards Only in /tmp/workspace/generated-lookml/: shared_private Only in /tmp/workspace/looker-hub/: user_journey diff -x '.*' -bur --no-dereference --new-file /tmp/workspace/looker-hub/namespaces.yaml /tmp/workspace/generated-lookml/namespaces.yaml --- /tmp/workspace/looker-hub/namespaces.yaml 2024-10-07 18:38:33.915186247 +0000 +++ /tmp/workspace/generated-lookml/namespaces.yaml 2024-10-07 18:38:33.851185971 +0000 @@ -6326,7 +6326,6 @@ shared: glean_app: false owners: - - anicholson@mozilla.com - ascholtz@mozilla.com pretty_name: Shared spoke: looker-spoke-default @@ -6343,6 +6342,17 @@ tables: - table: mozdata.static.data_incidents_v1 type: table_view +shared_private: + glean_app: false + owners: + - ascholtz@mozilla.com + pretty_name: Shared Private + spoke: looker-spoke-private + views: + countries: + tables: + - table: mozdata.static.country_codes_v1 + type: table_view subscription_platform: explores: active_subscriptions: diff -x '.*' -bur --no-dereference --new-file /tmp/workspace/looker-hub/shared_private/datagroups/country_codes_v1_last_updated.datagroup.lkml /tmp/workspace/generated-lookml/shared_private/datagroups/country_codes_v1_last_updated.datagroup.lkml --- /tmp/workspace/looker-hub/shared_private/datagroups/country_codes_v1_last_updated.datagroup.lkml 1970-01-01 00:00:00.000000000 +0000 +++ /tmp/workspace/generated-lookml/shared_private/datagroups/country_codes_v1_last_updated.datagroup.lkml 2024-10-07 18:36:26.000000000 +0000 @@ -0,0 +1,16 @@ +# *Do not manually modify this file* + +# This file has been generated via https://github.com/mozilla/lookml-generator + +# Using a datagroup in an Explore: https://cloud.google.com/looker/docs/reference/param-explore-persist-with +# Using a datagroup in a derived table: https://cloud.google.com/looker/docs/reference/param-view-datagroup-trigger + +datagroup: country_codes_v1_last_updated { + label: "Country Codes V1 Last Updated" + sql_trigger: SELECT MAX(storage_last_modified_time) + FROM `mozdata`.`region-us`.INFORMATION_SCHEMA.TABLE_STORAGE + WHERE table_schema = 'static' + AND table_name = 'country_codes_v1' ;; + description: "Updates when mozdata.static.country_codes_v1 is modified." + max_cache_age: "24 hours" +} \ No newline at end of file diff -x '.*' -bur --no-dereference --new-file /tmp/workspace/looker-hub/shared_private/views/countries.view.lkml /tmp/workspace/generated-lookml/shared_private/views/countries.view.lkml --- /tmp/workspace/looker-hub/shared_private/views/countries.view.lkml 1970-01-01 00:00:00.000000000 +0000 +++ /tmp/workspace/generated-lookml/shared_private/views/countries.view.lkml 2024-10-07 18:35:11.000000000 +0000 @@ -0,0 +1,63 @@ + +# *Do not manually modify this file* +# +# This file has been generated via https://github.com/mozilla/lookml-generator +# You can extend this view in the looker-spoke-default project (https://github.com/mozilla/looker-spoke-default) + +view: countries { + dimension: ads_value_tier { + sql: ${TABLE}.ads_value_tier ;; + type: string + description: "Lowercase label detailing the monetary value tier that Mozilla Ads assign to that region based on market size and our existing products, e.g., tier 1, tier 2, etc." + } + + dimension: code { + sql: ${TABLE}.code ;; + type: string + description: "ISO 3166 alpha-2 country code" + } + + dimension: code_3 { + sql: ${TABLE}.code_3 ;; + type: string + description: "ISO 3166 alpha-3 country code" + } + + dimension: mozilla_vpn_available { + sql: ${TABLE}.mozilla_vpn_available ;; + type: yesno + description: "Whether Mozilla VPN is available in this country." + } + + dimension: name { + sql: ${TABLE}.name ;; + type: string + description: "Official country name per ISO 3166" + } + + dimension: pocket_available_on_newtab { + sql: ${TABLE}.pocket_available_on_newtab ;; + type: yesno + description: "Whether Pocket is available on the newtab page in this country. Note that Pocket might only be available in certain locales/languages within a country." + } + + dimension: region_name { + sql: ${TABLE}.region_name ;; + type: string + description: "Region name. These are based on the UN Statistics Division standard country or area codes for statistical use (M49), but with the \"Americas\" region split into \"North America\" and \"South America\"." + } + + dimension: sponsored_tiles_available_on_newtab { + sql: ${TABLE}.sponsored_tiles_available_on_newtab ;; + type: yesno + description: "Whether sponsored tiles are available on the newtab page in this country. Note that Pocket might only be available in certain locales/languages within a country." + } + + dimension: subregion_name { + sql: ${TABLE}.subregion_name ;; + type: string + description: "Sub-region name. These are based on UN Statistics Division standard country or area codes for statistical use (M49), but with the \"Latin America and the Caribbean\" and \"Sub-Saharan Africa\" sub-regions split into more specific sub-regions." + } + + sql_table_name: `mozdata.static.country_codes_v1` ;; +} \ No newline at end of file diff -x '.*' -bur --no-dereference --new-file /tmp/workspace/looker-hub/user_journey/views/events_daily.view.lkml /tmp/workspace/generated-lookml/user_journey/views/events_daily.view.lkml --- /tmp/workspace/looker-hub/user_journey/views/events_daily.view.lkml 2024-10-07 18:38:33.719185400 +0000 +++ /tmp/workspace/generated-lookml/user_journey/views/events_daily.view.lkml 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -view: events_daily { - sql_table_name: `mozdata.messaging_system.events_daily` - ;; - - dimension: addon_version { - type: string - sql: ${TABLE}.addon_version ;; - } - - dimension: app_version { - type: string - sql: ${TABLE}.app_version ;; - } - - dimension: city { - type: string - sql: ${TABLE}.city ;; - } - - dimension: client_id { - type: string - sql: ${TABLE}.client_id ;; - } - - dimension: country { - type: string - map_layer_name: countries - sql: ${TABLE}.country ;; - } - - dimension: events { - type: string - sql: ${TABLE}.events ;; - hidden: yes - } - - dimension: experiments { - hidden: yes - sql: ${TABLE}.experiments ;; - } - - dimension: locale { - type: string - sql: ${TABLE}.locale ;; - } - - dimension: normalized_channel { - type: string - sql: ${TABLE}.normalized_channel ;; - } - - dimension: os { - type: string - sql: ${TABLE}.os ;; - } - - dimension: sample_id { - type: number - sql: ${TABLE}.sample_id ;; - } - - dimension: subdivision1 { - type: string - sql: ${TABLE}.subdivision1 ;; - } - - dimension: submission_date { - type: date - sql: CAST(${TABLE}.submission_date AS TIMESTAMP) ;; - } -} ```

Link to full diff