jason810496 opened a new pull request, #76019:
URL: https://github.com/apache/airflow/pull/76019

   `InterfaceExampleBuilder` registered its task handlers as a `DagDef`, which 
declares a Dag defined in Java. The example jar then declared 
`java_interface_example`, the same id as the Python Dag in `java_examples.py`. 
When the jar directory is also a Dag bundle, as the example README sets it up, 
the jar's Dag replaces the Python one, and its runs fail with `This task 
belongs to a native Lang-SDK Dag and cannot run in Python`.
   
   The interface example now registers task handlers against the Python Dag:
   
   ```java
   public static Bundle registerInto(Bundle bundle) {
     return bundle
         .register(DAG_ID, "extract", Extract.class)
         .register(DAG_ID, "transform", Transform.class)
         .register(DAG_ID, "summarize", Summarize.class);
   }
   ```
   
   The three Python Dags with stub TaskHandlers are renamed so they stand apart 
from the `java_native_*` Dag definitions:
   
   | Before | After |
   | --- | --- |
   | `java_annotation_example` | `java_task_handler_annotation_example` |
   | `java_interface_example` | `java_task_handler_interface_example` |
   | `java_xcom_casting_example` | `java_task_handler_xcom_casting_example` |
   
   Tested by building the example bundle against the `1.0.0-SNAPSHOT` Java SDK 
and running it on Airflow 3.4.0rc1 with the example README's config. All 6 
example Dags succeed, and `java_task_handler_interface_example` stays in the 
`dags-folder` bundle. The e2e test is updated for the new Dag ids. Its Dag 
processor does not mount the jar directory, which is why it never hit the 
collision.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) 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]

Reply via email to