Hi Sakshi,

Thanks for bringing this to the list - #29275 is a real gap, and I agree
it does not need a full AIP. But since the request is for consensus on the
schema, I looked at the PR (head 41fedb6) with that in mind, and I don't
think the schema is ready yet. So please treat this as an objection for
now - hopefully a constructive one.

Schema / correctness:

1. The primary key does not include the file. It stays
   (dag_id, warning_type), and all parse-failure rows use the constant
   type "user:dynamic_dag_failure". Two files reporting the same failing
   dag_id therefore share one row: the second file's merge overwrites the
   first one's filename, and the next parse of either file deletes the
   other file's warning. Since the dag_id here does not have to exist in
   the dag table, collisions are realistic. It also limits each file to a
   single warning per dag_id.

2. Visibility is looser than for import errors. The import error endpoint
   redacts the stacktrace unless the user can read all Dags in the file.
   The new filter shows a parse-failure row to anyone who can read any Dag
   in that file - and emit_dag_warning appends the stacktrace to the
   message. In multi-team setups that can expose another team's
   tracebacks.

3. If all factories in a file fail, nobody sees the warning: visibility is
   resolved through DagModel rows of that file, and there are none.

4. It duplicates the import_error machinery inside a per-Dag table.
   import_error is already file-scoped (bundle_name, filename,
   stacktrace), replaced per parse and cleaned up for removed files.
   dag_warning, on the other hand, already has per-Dag reconciliation of
   its warning types on every parse; adding a second, per-file
   delete-and-replace cycle with a different key to the same table is
   what leads to problem 1. I'd like the proposal to explain why this
   belongs in dag_warning rather than in a separate table or an extension
   of import_error (for example a kind/severity column, keeping in mind
   that import errors currently mark the file's Dags as having import
   errors).

How it fits with the parsing-separation work:

5. Isolated Dag processor (AIP-92). On main the Dag processor can already
   run without DB access and publishes parse results through the
   Execution API (execution_api/routes/dag_parsing.py). The PR only
   changes the direct-DB path: in API mode results go through the pending
   publications and never reach persist_parsing_result, the ParseWarning
   wire model has no bundle/file scope, and publish_parse_result does not
   pass parse_failure_warnings. So on an isolated deployment the warnings
   are silently dropped. Orphan cleanup also lives only in the local
   bundle-refresh branch, which API mode skips. And the route's warning
   filter is commented as relying on the foreign key that the PR drops.

6. Importers (AIP-85, and the YAML Dag format built on it). The warnings
   are collected through a global side channel (DagContext) fed by a
   Python call while the module executes. That only works for the Python
   importer - a YAML or other importer has no module code to call it from,
   although it is the component that knows best which definitions failed.

7. Parsing through executors (AIP-130) moves parsing even further away
   from the manager, so anything not carried in the parse result will not
   reach the DB.

What I'd suggest instead: make "partial parse failure" records part of
the parse-result contract (DagParseResultBody, with bundle and file
scope, as a versioned Execution API change), have importers return them
(with emit_dag_warning as one way the Python importer produces them),
persist and clean them up the same way on both the DB and the API paths,
and use a key that includes the file. With that settled, the storage
decision (dag_warning without the FK vs. a dedicated table vs.
import_error) becomes much easier to judge. Parity for the Go/Java/TS
SDKs can be an explicit follow-up.

Smaller items for the PR: DagWarning.purge_inactive_dag_warnings is
re-added although main removed it in #74791 and nothing calls it (looks
like a rebase leftover); the stacktrace argument has no column of its own,
so it should either be stored separately and redacted like import errors,
or dropped; and paths that relied on the cascade (db clean of the dag
table) would now leave orphaned rows.

Happy to look again once the proposal covers these.

J.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to