Lee-W commented on code in PR #68886:
URL: https://github.com/apache/airflow/pull/68886#discussion_r3457715405


##########
airflow-core/docs/core-concepts/asset-state-store.rst:
##########
@@ -37,6 +37,8 @@ When is ``asset_state_store`` available?
 
 When using asset state store within a task, ``context["asset_state_store"]`` 
is populated for **concrete** :class:`~airflow.sdk.definitions.asset.Asset` 
inlets and outlets. A task must declare at least one concrete inlet or outlet 
for ``asset_state_store`` to contain any entries.
 
+If a task has no inlets or outlets and accesses 
``context["asset_state_store"]``, a ``KeyError`` is raised at runtime. Declare 
at least one asset inlet or outlet on the task to use asset state store.

Review Comment:
   It's correct, but not covered in the `@asset` case in an obvious way. Maybe 
let's add examples here?
   
   ```python
   @asset
   def this_is_dag(...):
       # this should work
       ...
   
   @dag
   def this_is_also_a_dag(...):
      @task(outlets=...)
      def this_is_a_task(...):
          # this should work
          ...
   ```



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