Add params to the DAG details endpoint (#13790)
This commit is contained in:
Родитель
2c6c7fdb23
Коммит
10b8ecc86f
|
@ -398,7 +398,7 @@ paths:
|
|||
description: >
|
||||
Presents only information available in database (DAGModel).
|
||||
|
||||
If you need detailed information, consider using GET /dags/{dag_id}/detail.
|
||||
If you need detailed information, consider using GET /dags/{dag_id}/details.
|
||||
x-openapi-router-controller: airflow.api_connexion.endpoints.dag_endpoint
|
||||
operationId: get_dag
|
||||
tags: [DAG]
|
||||
|
@ -1947,6 +1947,9 @@ components:
|
|||
default_view:
|
||||
type: string
|
||||
readOnly: true
|
||||
params:
|
||||
type: object
|
||||
readOnly: true
|
||||
|
||||
ExtraLink:
|
||||
type: object
|
||||
|
|
|
@ -81,6 +81,7 @@ class DAGDetailSchema(DAGSchema):
|
|||
dag_run_timeout = fields.Nested(TimeDeltaSchema, dump_only=True, attribute="dagrun_timeout")
|
||||
doc_md = fields.String(dump_only=True)
|
||||
default_view = fields.String(dump_only=True)
|
||||
params = fields.Dict(dump_only=True)
|
||||
|
||||
|
||||
class DAGCollection(NamedTuple):
|
||||
|
|
|
@ -74,7 +74,7 @@ class TestDagEndpoint(unittest.TestCase):
|
|||
access_control={'TestGranularDag': [permissions.ACTION_CAN_EDIT, permissions.ACTION_CAN_READ]},
|
||||
)
|
||||
|
||||
with DAG(cls.dag_id, start_date=datetime(2020, 6, 15), doc_md="details") as dag:
|
||||
with DAG(cls.dag_id, start_date=datetime(2020, 6, 15), doc_md="details", params={"foo": 1}) as dag:
|
||||
DummyOperator(task_id=cls.task_id)
|
||||
|
||||
with DAG(cls.dag2_id, start_date=datetime(2020, 6, 15)) as dag2: # no doc_md
|
||||
|
@ -206,6 +206,7 @@ class TestGetDagDetails(TestDagEndpoint):
|
|||
"is_subdag": False,
|
||||
"orientation": "LR",
|
||||
"owners": [],
|
||||
"params": {"foo": 1},
|
||||
"schedule_interval": {
|
||||
"__type": "TimeDelta",
|
||||
"days": 1,
|
||||
|
@ -237,6 +238,7 @@ class TestGetDagDetails(TestDagEndpoint):
|
|||
"is_subdag": False,
|
||||
"orientation": "LR",
|
||||
"owners": [],
|
||||
"params": {},
|
||||
"schedule_interval": {
|
||||
"__type": "TimeDelta",
|
||||
"days": 1,
|
||||
|
@ -273,6 +275,7 @@ class TestGetDagDetails(TestDagEndpoint):
|
|||
"is_subdag": False,
|
||||
"orientation": "LR",
|
||||
"owners": [],
|
||||
"params": {"foo": 1},
|
||||
"schedule_interval": {
|
||||
"__type": "TimeDelta",
|
||||
"days": 1,
|
||||
|
@ -308,6 +311,7 @@ class TestGetDagDetails(TestDagEndpoint):
|
|||
'is_subdag': False,
|
||||
'orientation': 'LR',
|
||||
'owners': [],
|
||||
"params": {"foo": 1},
|
||||
'schedule_interval': {'__type': 'TimeDelta', 'days': 1, 'microseconds': 0, 'seconds': 0},
|
||||
'start_date': '2020-06-15T00:00:00+00:00',
|
||||
'tags': None,
|
||||
|
|
|
@ -106,6 +106,7 @@ class TestDAGDetailSchema:
|
|||
doc_md="docs",
|
||||
orientation="LR",
|
||||
default_view="duration",
|
||||
params={"foo": 1},
|
||||
)
|
||||
schema = DAGDetailSchema()
|
||||
expected = {
|
||||
|
@ -122,6 +123,7 @@ class TestDAGDetailSchema:
|
|||
'is_subdag': False,
|
||||
'orientation': 'LR',
|
||||
'owners': [],
|
||||
'params': {'foo': 1},
|
||||
'schedule_interval': {'__type': 'TimeDelta', 'days': 1, 'seconds': 0, 'microseconds': 0},
|
||||
'start_date': '2020-06-19T00:00:00+00:00',
|
||||
'tags': None,
|
||||
|
|
Загрузка…
Ссылка в новой задаче