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


##########
task_sdk/src/airflow/sdk/definitions/asset/__init__.py:
##########
@@ -54,9 +55,26 @@ class AssetUniqueKey(NamedTuple):
     uri: str
 
     @staticmethod
-    def from_asset(asset: Asset) -> AssetUniqueKey:
+    def from_asset(asset: Asset | AssetModel) -> AssetUniqueKey:
         return AssetUniqueKey(name=asset.name, uri=asset.uri)
 
+    def to_obj(self) -> Asset:

Review Comment:
   I wonder if there’s a better name than `obj`… Python doesn’t seem to have an 
established convention for this. (Rust has `into()`, for example.)
   
   Also maybe the `from` part should also be `from_obj`? Not sure.



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