Allow DAG repo to be configured. (#3488)
To support more accurate DAG generation for the private-bigquery-etl repo.
This commit is contained in:
Родитель
945c4ee030
Коммит
589e9192e7
|
@ -117,6 +117,7 @@ class Dag:
|
|||
default_args: DagDefaultArgs
|
||||
tasks: List[Task] = attr.ib([])
|
||||
description: str = attr.ib("")
|
||||
repo: str = attr.ib("bigquery-etl")
|
||||
tags: List[str] = attr.ib([])
|
||||
|
||||
@name.validator
|
||||
|
@ -193,7 +194,7 @@ class Dag:
|
|||
name = list(d.keys())[0]
|
||||
tags: set[str] = set(d[name].get("tags", []))
|
||||
if not any(tag.startswith("repo/") for tag in tags):
|
||||
tags.add("repo/bigquery-etl")
|
||||
tags.add("repo/" + d[name].get("repo", "bigquery-etl"))
|
||||
d[name]["tags"] = sorted(tags)
|
||||
|
||||
if name == PUBLIC_DATA_JSON_DAG:
|
||||
|
|
|
@ -21,7 +21,7 @@ from utils.callbacks import retry_tasks_callback
|
|||
docs = """
|
||||
### {{ name }}
|
||||
|
||||
Built from bigquery-etl repo, [`dags/{{ name }}.py`](https://github.com/mozilla/bigquery-etl/blob/main/dags/{{ name }}.py)
|
||||
Built from {{ repo }} repo, [`dags/{{ name }}.py`](https://github.com/mozilla/{{ repo }}/blob/main/dags/{{ name }}.py)
|
||||
|
||||
{% if description != "" -%}
|
||||
#### Description
|
||||
|
|
Загрузка…
Ссылка в новой задаче