pierrejeambrun opened a new pull request, #74249: URL: https://github.com/apache/airflow/pull/74249
Stacked on #74037. ## Why A packed TypeScript bundle can declare several Dags, each mapped to its own source file via `dag_source_paths`. The Code tab showed the bundle's entry module for every one of them instead: `NodeDagImporter.get_source_code` always read the entrypoint, and the Dag processor read a bundle's source once per file and stored it under the file's own fileloc — every Dag sharing that file collided on the same key, so only one entry survived. ## What changes - `AbstractDagImporter.get_source_code` takes the Dag's own `dag_id` now. `NodeDagImporter` resolves that Dag's own mapped file, falling back to the entry module when there is none (an unmapped, dynamically-constructed Dag). Every other importer's signature grew the same parameter for a uniform interface; their implementation is unchanged — only `NodeDagImporter` uses it so far. - Source code read for a Dag file is now keyed by `dag_id` end to end (`DagBag.dag_source_codes`, `DagFileParsingResult.dag_source_codes`, `update_dag_parsing_results_in_db`'s lookup), since a fileloc is not unique per Dag the way a `dag_id` is — a plain Python file with several `@dag`-decorated functions has the same property, it just happened to be harmless there because every Dag in that case shares identical source anyway. ## Out of scope - Go has no Dag importer yet, so there is nothing to wire up there. - `JavaDagImporter` already has the per-`dag_id` lookup machinery in `_find_source_entry`, unused by `get_source_code`. Wiring it in is left for a follow-up; this PR only updates its signature. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 4.7) Generated-by: Claude Code (Opus 4.7) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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]
