Граф коммитов

4 Коммитов

Автор SHA1 Сообщение Дата
Chelsea Troy b98da3cfe6
Add and incrementally populate a table for google ads campaign cost metrics (#3468)
* Add and incrementally populate a table for google ads campaign cost metrics

* Register dag in dags.yaml

* make two strings match that apparently have to match

* Consistentify another thing in the dag

* Reformat a sql file

* Update sql/moz-fx-data-shared-prod/fenix_derived/google_ads_campaign_cost_breakdowns_v1/metadata.yaml

Add update dependency on upstream table

Co-authored-by: Lucia <30448600+lucia-vargas-a@users.noreply.github.com>

* Small adjustments apropos of review

* Attempt to fix verify-dags-up-to-date

* Evidently there are too many blank lines in the metadata file

* Stop dry running an access denied table
Also raise the line length limit on the linter, which otherwise prevented the needed change

* represent micros more accurately

* Update dags.yaml to include Frank as maintainer

Co-authored-by: Frank Bertsch <frank.bertsch@gmail.com>

* rename ad_clicks

* Update sql/moz-fx-data-shared-prod/fenix_derived/google_ads_campaign_cost_breakdowns_v1/query.sql

Co-authored-by: Frank Bertsch <frank.bertsch@gmail.com>

* Add conversions to columns of output table

* Group stats table by campaign id and date

* Add revenue generating ad clicks and disambiguate that number from marketing ad clicks

* SO IT TURNS OUT, campaigns with the same ID can have different names over time. This associates the appropriate names with each id so we can sum up metrics by campaign rather than by NAME of campaign.

* ./bqetl format /Users/chelseatroy/mozilla/bigquery-etl/sql/moz-fx-data-shared-prod/fenix_derived/google_ads_campaign_cost_breakdowns_v1/query.sql

* Document the fenix campaign identifier

* ./bqetl format

* ./bqetl dag generate bqetl_campaign_cost_breakdowns

* ./bqetl dag generate bqetl_org_mozilla_firefox_derived

Co-authored-by: Lucia <30448600+lucia-vargas-a@users.noreply.github.com>
Co-authored-by: Frank Bertsch <frank.bertsch@gmail.com>
2023-01-11 15:58:10 -06:00
Frank Bertsch efb49cf738
Dryrun stored procedures (#1367)
* Dryrun stored procedures

* Reformat SQL

* Update tests for reformatted sql

* Fix doc format again

* Let black run past max-line-length

Black does not mandate line-length, it only tries to adhere to it.
For that reason, we can't have flake8 fail at too-long line length.

https://black.readthedocs.io/en/stable/the_black_code_style.html#line-length

* Why doesn't pydoctest run locally?

* Apply suggestions from code review

Co-authored-by: Anna Scholtz <anna@scholtzan.net>

Co-authored-by: Anna Scholtz <anna@scholtzan.net>
2020-10-01 16:48:28 -04:00
Frank Bertsch 3caa5eb382
Event analysis udfs (#1343)
* WIP: Event analysis UDFs

* WIP: Some stored procedures for working with events

* Add UDF descriptions && move datasets

* Add capabilities for testing procedures

* Add procedures for creating funnel views

* Dryrun stored procedures

* Add support for count queries to events view

* Remove legacy stored procedures

* Remove dryruns

* Add explicit count support

* Change SQL to work around sqlparse bug

See https://github.com/andialbrecht/sqlparse/issues/583

* Run black

* Reformat SQL

* Reformat assertion

* Fix doc issues

* Add stored procedure test file

* Flake8 issue

* Reformat last file

* Ignore pre-colon whitespace failure

* Also ignore line breaks before binary operators

* Apply suggestions from code review

Co-authored-by: Anna Scholtz <anna@scholtzan.net>

* Fix sql lint

Co-authored-by: Anna Scholtz <anna@scholtzan.net>
2020-09-29 16:33:38 -04:00
Daniel Thorn 79070068ad
Add first test (#9) 2019-03-07 12:43:21 -08:00