Created
October 25, 2021 18:13
-
-
Save anna-geller/86685142f2870ceff135399ed1be10ac 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 prefect | |
from prefect import task, Flow | |
from prefect.storage import GitHub | |
from prefect.run_configs import LocalRun | |
FLOW_NAME = "03_dashboards" | |
STORAGE = GitHub( | |
repo="anna-geller/flow-of-flows", | |
path=f"flows/{FLOW_NAME}.py", | |
access_token_secret="GITHUB_ACCESS_TOKEN", | |
) | |
@task | |
def update_customers_dashboards(): | |
logger = prefect.context.get("logger") | |
# your logic here | |
logger.info("Customers dashboard extracts updated!") | |
@task | |
def update_sales_dashboards(): | |
logger = prefect.context.get("logger") | |
# your logic here | |
logger.info("Sales dashboard extracts updated!") | |
with Flow(FLOW_NAME, storage=STORAGE, run_config=LocalRun(labels=["dev"])) as flow: | |
customers = update_customers_dashboards() | |
sales = update_sales_dashboards() | |
customers.set_downstream(sales) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment