Source code for bhf_smarthealth.models

from enum import StrEnum, auto
from dataclasses import dataclass, field
from typing import Optional


[docs] class Environments(StrEnum): """Configure names of RONIN environments""" CORE = auto() ISOLATE_PROD = auto() ISOLATE_DEV = auto()
[docs] class DataStreamNames(StrEnum): """Configure pipeline data stream names""" GPS = auto() FITBIT = auto() HEALTHAPP = auto() QUALTRICS = auto() QUESTIONNAIRE = auto() CLEAN = auto()
[docs] class BucketNames(StrEnum): """Configure pipeline bucket names""" INGRESS = auto() REFERENCE = auto() RAW = auto() IDENTIFIERS = auto() INTERMEDIATE = auto() CLEAN = auto() LOGS = auto()
[docs] class PartitionFreqs(StrEnum): """Specify pipeline partitions""" DAILY = auto()
[docs] @dataclass(frozen=True) class IntermediateTable: name: str source_stream: DataStreamNames
[docs] class CleanTableNames(StrEnum): BRIDGE = auto() BASE = auto() FITBIT_SUMMARY = auto() FITBIT_INTRADAY = auto() LSOA = auto() MOBILITY = auto() ENVIRONMENTAL = auto() HEALTHAPP_METRICS = auto() HEALTHAPP_WORKOUTS = auto()
[docs] @dataclass(frozen=True) class CleanTable: name: CleanTableNames bucket: BucketNames source_stream: DataStreamNames primary_keys: list = field(default_factory=list) partition_freq: Optional[PartitionFreqs] = None
# upload_strategy: SmartHealthLoadingStrategy # schema: BaseModel