You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2025/03/27 00:51:26 UTC

Re: [I] [3.0.0] context dict for @asset erroneously requires additional ["context"] key [airflow]

uranusjr commented on issue #48411:
URL: https://github.com/apache/airflow/issues/48411#issuecomment-2756086731

   Oh I know the problem now, this is actually intended. The syntax is different between `@asset` and `@task` because we use the arguments differently. You should do this instead:
   
   ```python
   @asset(schedule="@daily")
   def access_context_asset(context):  # <-- No '**'
       print(context["dag_run"].run_after)
   ```
   
   Maybe we should add a rule to make `*` and `**` fail on `@asset` at parse time instead. They don’t make much sense there.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org