Skip to content

Commit e940a06

Browse files
authored
Merge pull request #220 from bcgov/chore/218-refactor-dags
chore/218 refactor dags
2 parents 2987f97 + a77db3c commit e940a06

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

dags/fetch_and_save_dag_from_github.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,26 @@
1010

1111
START_DATE = datetime.now() - timedelta(days=2)
1212

13-
14-
@dag(default_args=default_dag_args, schedule=None, start_date=START_DATE)
15-
def fetch_and_save_dag_from_github(org: str = '', repo: str = '', ref: str = '', path: str = ''):
16-
"""
17-
DAG to fetch dags and store them to a disk location.
18-
19-
:param org: Github organisation
20-
:type org: str
21-
22-
:param repo: Github repository
23-
:type repo: str
24-
25-
:param ref: the git ref to use when fetching the dag
26-
:type ref: str
27-
28-
:param path: the path to the dag to fetch, within the github repository
29-
:type path: str
30-
"""
31-
13+
DAG_DOC = """
14+
DAG to fetch dags and store them to a disk location.
15+
16+
The following parameters are available:
17+
18+
**org**(_str_): Github organization
19+
**repo**(_str_): Github repository
20+
**ref**(_str_): the git ref to use when fetching the dag
21+
**path**(_str_): the path to the dag to fetch, within the github repository
22+
"""
23+
24+
@dag(
25+
default_args=default_dag_args,
26+
schedule=None,
27+
start_date=START_DATE,
28+
doc_md=DAG_DOC,
29+
)
30+
def fetch_and_save_dag_from_github(
31+
org: str = "", repo: str = "", ref: str = "", path: str = ""
32+
):
3233
wait_seconds = settings.MIN_SERIALIZED_DAG_FETCH_INTERVAL + \
3334
settings.MIN_SERIALIZED_DAG_UPDATE_INTERVAL
3435

0 commit comments

Comments
 (0)