amoghrajesh commented on PR #67902:
URL: https://github.com/apache/airflow/pull/67902#issuecomment-4609575104

   Great conversation folks, I redid this as flat denormalized columns instead 
of a FK to `task_instance` and integrated a `kind` mode too.
   
   Now this is how it looks, recording these fields 
(`last_updated_by_kind/dag_id/run_id/task_id/map_index`) and an
   `AssetStoreWriterKind` enum (`task`/`watcher`/`api`). Main reasons:
   
   - Watchers (`BaseEventTrigger`) have no task instance, so a FK can't be the
     universal reference
   - Flat columns survive task instance cleanup; a FK would lose the history on 
delete
   
   | `kind` | `dag_id` | `run_id` | `task_id` | `map_index` |
   |--------|----------|----------|-----------|-------------|
   | `task` | set | set | set | set |
   | `watcher` | `null` | `null` | `null` | `null` |
   | `api` | `null` | `null` | `null` | `null` |
   
   Validation is enforced at write time via 
`AssetStoreWriterKind.validate_writer_fields()`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to