uranusjr commented on code in PR #57463:
URL: https://github.com/apache/airflow/pull/57463#discussion_r2472031663


##########
airflow-core/tests/unit/models/test_dag.py:
##########
@@ -2870,7 +2871,12 @@ def 
test_create_dagrun_disallow_manual_to_use_automated_run_id(run_id_type: DagR
     dag = DAG(dag_id="test", start_date=DEFAULT_DATE, schedule="@daily")
     run_id = DagRun.generate_run_id(run_type=run_id_type, 
run_after=DEFAULT_DATE, logical_date=DEFAULT_DATE)
 
-    with pytest.raises(ValueError) as ctx:
+    with pytest.raises(
+        ValueError,
+        match=re.escape(
+            f"A manual DAG run cannot use ID {run_id!r} since it is reserved 
for {run_id_type.value} runs"

Review Comment:
   (History time) This was inherited from `str.format()` since Python 2.6. With 
f-string available in modern Python, this syntax is kind of redundant since you 
can just do `{repr(run_id)}` instead, but the simplicity is still nice (and 
maybe ever so slightly faster). There’s also `!s`, which is equivalent to 
calling `str()`.



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