Created
October 31, 2022 12:02
-
-
Save anna-geller/de454169c9f2c78c1ba2a16d48808616 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from typing import List | |
def ingest(): | |
if random.random() > 0.5: | |
raise ValueError("Non-deterministic error has occured.") | |
else: | |
return 42 | |
def transform(x: int) -> int: | |
return x * 42 | |
def load(x): | |
print(x) | |
def clean_up(): | |
print("Cleaning up 🧹") | |
def refresh(dashboard: str): | |
print("Refreshing %s 📊", dashboard) | |
def get_dashboards(): | |
return ["sales", "growth", "margins", "COGS", "visitors"] | |
def refresh_bi_dashboards(dashboards: List[str]): | |
for i in dashboards: | |
refresh(i) | |
def orchestrate(): | |
data = ingest() | |
final = transform(data) | |
load(final) | |
dashboards = get_dashboards() | |
refresh_bi_dashboards(dashboards) | |
clean_up() | |
if __name__ == "__main__": | |
orchestrate() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment