Skip to content
Snippets Groups Projects
Commit e5eade13 authored by Jedrzej Rybicki's avatar Jedrzej Rybicki
Browse files

further testing of dag params

parent 13c537c4
No related branches found
No related tags found
No related merge requests found
Pipeline #76927 passed
......@@ -29,4 +29,5 @@ class B2ShareOperator(BaseOperator):
#print(f"Retrieving info from {self.connection.host}")
lst = get_objects(server=server)
print(f"GOT: {lst}")
print(self.params)
return message
"Example of new taskflow api"
from airflow.decorators import dag, task
from airflow.utils.dates import days_ago
default_args = {
'owner': 'airflow',
}
@dag(default_args=default_args, schedule_interval=None, start_date=days_ago(2), tags=['example'])
def taskflow_example():
@task()
def extract():
return {'key': 'value', 'key2': 'value2'}
@task(multiple_outputs=True)
def transform(inps: dict):
return {"keys": len(inps)}
@task()
def load(lengths: float):
print(f"Total length value is: {lengths:.2f}")
data = extract()
summary = transform(data)
load(summary["keys"])
dag = taskflow_example()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment