Skip to content

Instantly share code, notes, and snippets.

@anna-geller
Created October 31, 2022 12:02
Show Gist options
  • Save anna-geller/de454169c9f2c78c1ba2a16d48808616 to your computer and use it in GitHub Desktop.
Save anna-geller/de454169c9f2c78c1ba2a16d48808616 to your computer and use it in GitHub Desktop.
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