uranusjr commented on code in PR #41325:
URL: https://github.com/apache/airflow/pull/41325#discussion_r1837532033
##########
airflow/utils/context.py:
##########
@@ -281,10 +289,13 @@ def __getitem__(self, key: int | str | Asset |
AssetAlias) -> LazyAssetEventSele
asset_alias = self._asset_aliases[obj.name]
join_clause = AssetEvent.source_aliases
where_clause = AssetAliasModel.name == asset_alias.name
- elif isinstance(obj, (Asset, str)):
+ elif isinstance(obj, (Asset, AssetRef)):
+ join_clause = AssetEvent.asset
+ where_clause = AssetModel.name == self._assets[obj.name].name
+ elif isinstance(obj, str):
asset = self._assets[extract_event_key(obj)]
join_clause = AssetEvent.asset
- where_clause = AssetModel.uri == asset.uri
+ where_clause = AssetModel.name == asset.name
Review Comment:
Hmm… I wonder if we should try to support _both_ name and URI here. Also
this current code would not work because `extract_event_key` returns the URI.
--
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]