bigquery-etl/sql_generators/glean_usage/metrics_clients_last_seen.py

31 строка
911 B
Python
Исходник Обычный вид История

"""Generate and run metrics_clients_last_seen queries for Glean apps."""
2021-10-05 21:27:13 +03:00
import os
from pathlib import Path
2021-10-05 21:36:16 +03:00
2021-10-05 21:27:13 +03:00
import yaml
2021-12-16 00:49:53 +03:00
from sql_generators.glean_usage.common import GleanTable
2021-10-05 21:27:13 +03:00
TARGET_TABLE_ID = "metrics_clients_last_seen_v1"
PREFIX = "metrics_clients_last_seen"
2021-10-05 21:27:13 +03:00
2021-10-05 21:36:16 +03:00
class MetricsClientsLastSeen(GleanTable):
"""Represents generated metrics_clients_last_seen table."""
2021-10-05 21:27:13 +03:00
def __init__(self):
"""Initialize metrics_clients_last_seen table."""
2021-10-05 21:27:13 +03:00
GleanTable.__init__(self)
self.target_table_id = TARGET_TABLE_ID
self.no_init = True
self.per_app_id_enabled = False
self.cross_channel_template = None
2021-10-05 21:36:16 +03:00
with open(
Path(os.path.dirname(__file__)) / "templates" / "metrics_templating.yaml",
"r",
) as f:
2021-10-05 21:27:13 +03:00
metrics_config = yaml.safe_load(f) or {}
self.custom_render_kwargs = {"metrics": metrics_config}