Hi everyone,
We're really close to getting the OpenAPI spec merged, just one last
question that's come up around how we should handle/represent
dagrun.conf to triggerDagRun.
Which of the these two do people prefer?
POST /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}
Content-Type: application/json
{
"dag_run_id": "manual_2020-05-28T21:42:36Z",
"execution_date": "2020-05-28T21:42:36Z",
"conf": "{\"key\": \"value\" }"
}
OR
POST /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}
Content-Type: application/json
{
"dag_run_id": "manual_2020-05-28T21:42:36Z",
"execution_date": "2020-05-28T21:42:36Z",
"conf": {"key": "value"}
}
i.e. should the schema/type of conf be a (JSON-encoded) string, or an object.
I favour the later, Kamil the former. His point is that staticly typed
languages, and Java in particular, would be hard to represent this.
(Please correct me if I've over-simplified or misunderstood your
argument Kamil)
Mine was that it's easy enough in Go, for example trigger(dagRunId str,
executionDate *time.Time, conf interface{})`, and double json encoding
is always messy/a pain to drive manually on cURL etc.
(Using dagRun.conf is quite rare right now, doubly so via the API, so I
don't think we have any precendent to follow.)
Or does anyone feel strongly that we should support both, and have this
in the python side
if conf:
if isinstance(conf, dict):
run_conf = conf
else:
run_conf = json.loads(conf)
-ash