Skip to content

Instantly share code, notes, and snippets.

@kapilgarg
Last active January 16, 2024 09:36
Show Gist options
  • Save kapilgarg/02d8251987deafa1e6c284135536351b to your computer and use it in GitHub Desktop.
Save kapilgarg/02d8251987deafa1e6c284135536351b to your computer and use it in GitHub Desktop.
from airflow.decorators import dag,task
import pendulum
import airflow1
@dag(dag_id='dag_tutorial_1', schedule=None, start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),catchup=False,tags=["example"],)
def airflow_dag_tutorial():
@task
def get_stock_price():
return airflow1.get_stock_price()
@task
def clean(filepath):
return airflow1.clean(filepath)
@task
def compute(filepath):
return airflow1.compute(filepath)
output_path = get_stock_price()
clean_data = clean(output_path)
corr_matrix = compute(clean_data)
airflow_dag_tutorial()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment