jason810496 commented on code in PR #60810:
URL: https://github.com/apache/airflow/pull/60810#discussion_r2751308433


##########
providers/standard/tests/unit/standard/operators/test_trigger_dagrun.py:
##########
@@ -552,17 +552,23 @@ def teardown_method(self):
             for dbmodel in [DagModel, DagRun, TaskInstance]:
                 
session.execute(delete(dbmodel).where(dbmodel.dag_id.in_([TRIGGERED_DAG_ID, 
TEST_DAG_ID])))
 
-    def test_trigger_dagrun(self, dag_maker, mock_supervisor_comms):
+    def test_trigger_dagrun(self, dag_maker, mock_supervisor_comms, caplog):
+        import logging
+
         """Test TriggerDagRunOperator."""
+        caplog.set_level(logging.WARNING)
         with time_machine.travel("2025-02-18T08:04:46Z", tick=False):
             with dag_maker(TEST_DAG_ID, default_args={"start_date": 
DEFAULT_DATE}, serialized=True):
-                task = TriggerDagRunOperator(task_id="test_task", 
trigger_dag_id=TRIGGERED_DAG_ID)
+                task = TriggerDagRunOperator(
+                    task_id="test_task", trigger_dag_id=TRIGGERED_DAG_ID, 
note="Test note"
+                )
             dag_maker.sync_dagbag_to_db()
             parse_and_sync_to_db(self.f_name)
             dag_maker.create_dagrun()
             task.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, 
ignore_ti_state=True)
 
             dagrun = 
dag_maker.session.scalar(select(DagRun).where(DagRun.dag_id == 
TRIGGERED_DAG_ID))
+            assert "Parameter 'note' is not supported in Airflow 2.x and will 
be ignored." in caplog.text

Review Comment:
   Final nit: We need to replace the `caplog` usage with mocking the logger 
instead. Since there were some flaky tests caused by `caplog`, so we should 
avoid it being added to new test.



-- 
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