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


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -3133,9 +3123,21 @@ def _generate_warning_message(
         def _activate_assets_generate_warnings() -> Iterator[tuple[str, str]]:
             incoming_name_to_uri: dict[str, str] = {}
             incoming_uri_to_name: dict[str, str] = {}
-            for asset in assets:
-                if (asset.name, asset.uri) in active_assets:
-                    continue
+            for asset in session.scalars(
+                select(AssetModel)
+                .join(
+                    assets_query,
+                    and_(
+                        assets_query.c.name == AssetModel.name,
+                        assets_query.c.uri == AssetModel.uri,
+                    ),
+                )
+                .where(
+                    ~active_assets_query.where(
+                        and_(AssetActive.name == AssetModel.name, 
AssetActive.uri == AssetModel.uri)
+                    ).exists()
+                )
+            ):

Review Comment:
   I’d prefer this query be separated to its own. This `for asset in ...` is 
much too big.



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