Copilot commented on code in PR #66107:
URL: https://github.com/apache/airflow/pull/66107#discussion_r3182263298


##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -691,6 +701,15 @@ def update_bundle_state(
             values["version"] = version
         session.execute(update(DagBundleModel).where(DagBundleModel.name == 
bundle_name).values(**values))
 
+    def purge_inactive_dag_warnings(self) -> None:
+        """
+        Purge expired DAG warnings.
+
+        Default implementation deletes records from the metadata DB; override 
to

Review Comment:
   Docstring says "Purge expired DAG warnings", but the delegated 
implementation (`DagWarning.purge_inactive_dag_warnings`) purges warnings for 
*inactive/stale* DAGs (not time-expired warnings). Please adjust the wording to 
match the actual behavior to avoid confusion for subclass authors overriding 
this seam.
   



##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -537,6 +537,16 @@ def claim_priority_files(self) -> list[DagFileInfo]:
         """
         return self._claim_priority_files()
 
+    def request_bundle_refresh(self, bundle_names: Iterable[str]) -> None:
+        """
+        Request that the given bundles be refreshed on the next refresh tick.
+
+        Use this from event handlers reacting to external signals to mark
+        bundles as needing refresh; the next call to 
:meth:`_refresh_dag_bundles`
+        will not skip them via :meth:`should_skip_refresh`.
+        """
+        self._force_refresh_bundles.update(bundle_names)

Review Comment:
   `request_bundle_refresh()` accepts an `Iterable[str]`, so if a caller 
accidentally passes a single bundle name as a plain string (e.g. `"bundleone"`) 
it will be treated as an iterable of characters and add `{'b','u',...}` to 
`_force_refresh_bundles`. Since this is a new public seam intended for external 
event handlers, it would be safer to either (a) accept `bundle_name: str | 
Iterable[str]` and special-case `str`, or (b) validate/raise when 
`bundle_names` is a `str` to prevent hard-to-debug behavior.
   



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