JH-A-Kim commented on code in PR #68106:
URL: https://github.com/apache/airflow/pull/68106#discussion_r3384711831


##########
task-sdk/src/airflow/sdk/execution_time/request_handlers.py:
##########
@@ -272,3 +346,242 @@ def handle_get_xcom(client: Client, msg: GetXCom) -> 
tuple[BaseModel | None, dic
         xcom_result = XComResult.from_xcom_response(xcom)
         return xcom_result, {"exclude_unset": True}
     return xcom, {}
+
+
+@handles(GetAssetByName)
+def handle_get_asset_by_name(client: Client, msg: GetAssetByName) -> 
tuple[BaseModel | None, dict[str, bool]]:
+    asset_resp = client.assets.get(name=msg.name)
+    if isinstance(asset_resp, AssetResponse):
+        asset_result = AssetResult.from_asset_response(asset_resp)
+        return asset_result, {"exclude_unset": True}
+    return asset_resp, {}
+
+
+@handles(GetAssetByUri)
+def handle_get_asset_by_uri(client: Client, msg: GetAssetByUri) -> 
tuple[BaseModel | None, dict[str, bool]]:
+    asset_resp = client.assets.get(uri=msg.uri)
+    if isinstance(asset_resp, AssetResponse):
+        asset_result = AssetResult.from_asset_response(asset_resp)
+        return asset_result, {"exclude_unset": True}
+    return asset_resp, {}
+
+
+@handles(GetAssetsByAlias)
+def handle_get_assets_by_alias(
+    client: Client, msg: GetAssetsByAlias
+) -> tuple[BaseModel | None, dict[str, bool]]:
+    asset_resp = client.assets.get_by_alias(alias_name=msg.alias_name)
+    if isinstance(asset_resp, AssetResponse):

Review Comment:
   I just verified with the original supervisor.py and yeah it can just be 
get_by_alias, ill fix this!



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