Lee-W commented on code in PR #41325:
URL: https://github.com/apache/airflow/pull/41325#discussion_r1837537401
##########
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:
I'm actually thinking of removing `str` support entirely. As we support more
and more types, passing a string could be pretty confusing.
--
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]