-
Notifications
You must be signed in to change notification settings - Fork 143
feat(etl): Update subscription deletion ETL scripts #9216
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- | ||
| friendly_name: Subscription Platform Backend Cirrus Delete Events | ||
| description: Deletion events for subscription platform backend cirrus, derived | ||
| from payments-api GKE logs containing pre-derived nimbus_user_id | ||
| owners: | ||
| - dalvarez@mozilla.com | ||
| labels: | ||
| incremental: true | ||
| schedule: daily | ||
| table_type: client_level | ||
| scheduling: | ||
| dag_name: bqetl_fxa_events | ||
| bigquery: | ||
| time_partitioning: | ||
| type: day | ||
| field: submission_timestamp | ||
| require_partition_filter: false | ||
| require_column_description: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| SELECT | ||
| MIN(`timestamp`) AS submission_timestamp, | ||
| jsonPayload.fields.nimbus_user_id AS nimbus_user_id, | ||
| FROM | ||
| `moz-fx-fxa-prod.gke_fxa_prod_log.stderr` | ||
| WHERE | ||
| ( | ||
| DATE(_PARTITIONTIME) | ||
| BETWEEN DATE_SUB(@submission_date, INTERVAL 1 DAY) | ||
| AND DATE_ADD(@submission_date, INTERVAL 1 DAY) | ||
| ) | ||
| AND DATE(`timestamp`) = @submission_date | ||
| AND jsonPayload.type = 'glean.user.delete' | ||
| AND jsonPayload.fields.nimbus_user_id IS NOT NULL | ||
| GROUP BY | ||
| jsonPayload.fields.nimbus_user_id |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,9 @@ | ||||||||
| fields: | ||||||||
| - name: submission_timestamp | ||||||||
| type: TIMESTAMP | ||||||||
| mode: NULLABLE | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A description is useful here because the meaning of
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to add |
||||||||
| description: Earliest timestamp of the account deletion log entry for this nimbus_user_id on the given date | ||||||||
| - name: nimbus_user_id | ||||||||
| type: STRING | ||||||||
| mode: NULLABLE | ||||||||
| description: Pre-derived Nimbus user identifier logged by payments-api at account deletion time | ||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expectation is that new tables have column descriptions in the schema.yaml and this should be set
Creating tables via the cli will add this but can get missed when copy/pasting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to add
require_column_description: true