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


##########
task-sdk/src/airflow/sdk/execution_time/context.py:
##########
@@ -635,13 +639,15 @@ def get(self, key: str) -> str | None:
             raise AirflowRuntimeError(resp)
         if isinstance(resp, AssetStateResult):
             stored = resp.value
-            # if custom backend is configured, the stored value in DB is a 
reference, fetch the actual value from
-            # custom backend using the reference
             backend = _get_worker_state_backend()
-            return backend.deserialize_asset_state_from_ref(stored) if backend 
else stored
+            if backend is not None:
+                # serialize_asset_state_to_ref always returns str by contract; 
stored is the ref.
+                # stored is always str here: serialize_asset_state_to_ref 
always returns str

Review Comment:
   Done, made both accessors now use `if TYPE_CHECKING: assert 
isinstance(stored, str)` for consistency. And removed repeated comment too



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