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

Define event_monitoring_live_v1 views in view.sql files #4576

Merged
merged 18 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
344c091
Define `event_monitoring_live_v1` views in `view.sql` files.
sean-rose Nov 16, 2023
ffb4abe
Overwrite existing `event_monitoring_live_v1` views on deployment.
sean-rose Nov 16, 2023
a472eb3
Support materialized views in view naming validation.
sean-rose Nov 16, 2023
08da23b
Merge branch 'main' into event_monitoring_live_v1-views
sean-rose Nov 16, 2023
eb7e0c3
Update `EventMonitoringLive.no_init` logic.
sean-rose Nov 16, 2023
de673f3
Apply formatting required by Black.
sean-rose Nov 16, 2023
4372bd9
Don't try to overwrite existing `event_monitoring_live_v1` views on d…
sean-rose Nov 17, 2023
efe99b0
Handle `IF NOT EXISTS` in view naming validation.
sean-rose Nov 17, 2023
12808ce
Use regular expression to extract view ID in view naming validation.
sean-rose Nov 28, 2023
7a6651b
Update other view regular expressions to allow for materialized views.
sean-rose Nov 28, 2023
43c3944
Merge branch 'main' into event_monitoring_live_v1-views
sean-rose Nov 28, 2023
deb8007
Merge branch 'main' into event_monitoring_live_v1-views
sean-rose Nov 28, 2023
e6ee23f
Merge branch 'main' into event_monitoring_live_v1-views
sean-rose Nov 28, 2023
cd79f3b
Merge branch 'main' into event_monitoring_live_v1-views
sean-rose Nov 30, 2023
b83abad
Merge branch 'main' into event_monitoring_live_v1-views
sean-rose Nov 30, 2023
7e0774d
Merge branch 'main' into event_monitoring_live_v1-views
sean-rose Nov 30, 2023
601207f
Merge branch 'main' into event_monitoring_live_v1-views
sean-rose Nov 30, 2023
b81b482
Merge branch 'main' into event_monitoring_live_v1-views
sean-rose Dec 8, 2023
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
2 changes: 1 addition & 1 deletion bqetl_project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ dry_run:
- sql/moz-fx-data-shared-prod/org_mozilla_firefox_beta_derived/experiment_events_live_v1/init.sql
- sql/moz-fx-data-shared-prod/telemetry_derived/experiment_enrollment_cumulative_population_estimate_v1/view.sql
- sql/moz-fx-data-shared-prod/telemetry/experiment_enrollment_cumulative_population_estimate/view.sql
- sql/moz-fx-data-shared-prod/**/event_monitoring_live_v1/init.sql
- sql/moz-fx-data-shared-prod/**/event_monitoring_live_v1/view.sql
- sql/moz-fx-data-shared-prod/monitoring/event_monitoring_live/view.sql
# Already exists (and lacks an "OR REPLACE" clause)
- sql/moz-fx-data-shared-prod/org_mozilla_firefox_derived/clients_first_seen_v1/init.sql
Expand Down
8 changes: 4 additions & 4 deletions sql_generators/glean_usage/event_monitoring_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def generate_per_app_id(
):
tables = table_names_from_baseline(baseline_table, include_project_id=False)

init_filename = f"{self.target_table_id}.init.sql"
view_filename = f"{self.target_table_id}.view.sql"
metadata_filename = f"{self.target_table_id}.metadata.yaml"

table = tables[f"{self.prefix}"]
Expand Down Expand Up @@ -69,8 +69,8 @@ def generate_per_app_id(
artifacts = []

if not self.no_init:
sean-rose marked this conversation as resolved.
Show resolved Hide resolved
init_sql = render(
init_filename, template_folder=PATH / "templates", **render_kwargs
view_sql = render(
view_filename, template_folder=PATH / "templates", **render_kwargs
)
metadata = render(
metadata_filename,
Expand All @@ -84,7 +84,7 @@ def generate_per_app_id(

if output_dir:
if not self.no_init:
artifacts.append(Artifact(table, "init.sql", init_sql))
artifacts.append(Artifact(table, "view.sql", view_sql))

for artifact in artifacts:
destination = (
Expand Down