jason810496 commented on code in PR #60810:
URL: https://github.com/apache/airflow/pull/60810#discussion_r2744451284
##########
providers/standard/src/airflow/providers/standard/operators/trigger_dagrun.py:
##########
@@ -288,6 +291,13 @@ def _trigger_dag_af_3(self, context, run_id,
parsed_logical_date):
deferrable=self.deferrable,
)
+ if self.note:
+ sig = inspect.signature(DagRunTriggerException.__init__)
+ if "note" in sig.parameters:
+ kwargs_accepted["note"] = self.note
Review Comment:
```suggestion
if self.note and "note" in
inspect.signature(DagRunTriggerException.__init__).parameters:
kwargs_accepted["note"] = self.note
```
##########
providers/standard/tests/unit/standard/operators/test_trigger_dagrun.py:
##########
@@ -114,9 +114,7 @@ def test_trigger_dagrun(self):
"""
with time_machine.travel("2025-02-18T08:04:46Z", tick=False):
task = TriggerDagRunOperator(
- task_id="test_task",
Review Comment:
From my perspective, we need to add compatibility test for AF2 as well.
e.g.
```python
if AIRFLOW_V_3_0_PLUS:
# AF3 expected behavior
else:
# AF2 expected behavior
# assert we will get the warning, etc
```
##########
providers/standard/src/airflow/providers/standard/operators/trigger_dagrun.py:
##########
@@ -274,7 +277,7 @@ def execute(self, context: Context):
def _trigger_dag_af_3(self, context, run_id, parsed_logical_date):
from airflow.providers.common.compat.sdk import DagRunTriggerException
- raise DagRunTriggerException(
+ kwargs_accepted = dict(
Review Comment:
One question: For `_trigger_dag_af_2` path, do we need to handle `note`?
e.g. If `note` is set for AF2, we could log warning for user.
--
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]