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


##########
airflow/utils/context.py:
##########
@@ -260,14 +212,13 @@ def __getitem__(self, key: int | Asset | AssetAlias | 
AssetRef) -> LazyAssetEven
                 raise KeyError(obj) from None
             join_clause = AssetEvent.asset
             where_clause = and_(AssetModel.uri == asset.uri, 
AssetModel.active.has())
-        else:
-            raise ValueError(key)
 
-        return LazyAssetEventSelectSequence.from_select(
-            select(AssetEvent).join(join_clause).where(where_clause),
-            order_by=[AssetEvent.timestamp],
-            session=self._session,
-        )
+        with create_session() as session:
+            return LazyAssetEventSelectSequence.from_select(
+                select(AssetEvent).join(join_clause).where(where_clause),
+                order_by=[AssetEvent.timestamp],
+                session=session,
+            )

Review Comment:
   When do we actually need this implementation?



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