amoghrajesh commented on code in PR #67619:
URL: https://github.com/apache/airflow/pull/67619#discussion_r3322545506


##########
task-sdk/src/airflow/sdk/execution_time/context.py:
##########


Review Comment:
   The error message will have to be updated here too



##########
task-sdk/tests/task_sdk/execution_time/test_context.py:
##########
@@ -1424,6 +1424,51 @@ def 
test_alias_inlet_no_resolved_assets_contributes_nothing(self, mock_superviso
 
         assert accessors._total == 0
 
+    def test_outlet_only_asset_is_accessible(self, mock_supervisor_comms):
+        asset = Asset(name=self.ASSET_NAME, uri=f"s3://{self.ASSET_NAME}")
+        mock_supervisor_comms.send.return_value = AssetStateResult(value="v1")
+
+        result = AssetStateAccessors([], [asset])[asset].get("watermark")
+
+        assert result == "v1"
+        mock_supervisor_comms.send.assert_called_once_with(
+            GetAssetStateByName(name=self.ASSET_NAME, key="watermark")
+        )
+
+    def test_outlet_only_uri_ref_is_accessible(self, mock_supervisor_comms):
+        ref = AssetUriRef(uri=self.ASSET_URI)
+        mock_supervisor_comms.send.return_value = AssetStateResult(value="v2")
+
+        result = AssetStateAccessors([], [ref])[ref].get("watermark")
+
+        assert result == "v2"
+        mock_supervisor_comms.send.assert_called_once_with(
+            GetAssetStateByUri(uri=self.ASSET_URI, key="watermark")
+        )

Review Comment:
   Missing test for `AssetNameRef`



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