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


##########
airflow-core/docs/core-concepts/operators.rst:
##########
@@ -84,11 +84,25 @@ Here, ``{{ ds }}`` is a templated variable, and because the 
``env`` parameter of
 
 You can also pass in a callable instead when Python is more readable than a 
Jinja template. The callable must accept two named arguments ``context`` and 
``jinja_env``:
 
+The ``context`` parameter is Airflow's ``Context`` object that provides access 
to runtime information about the current task execution. You can access its 
contents using standard dictionary syntax (``context["key"]``) for direct 
access , or ``context.get('key', default)`` for safer access with optional 
defaults. The context contains all the same variables that are available in 
Jinja templates. The context is read-only from the perspective of template 
rendering - while you can access and use its values, modifications won't affect 
the task execution environment.

Review Comment:
   Can we just say Context works like a Python dict? The first half of this 
paragraph spends a lot of words for a concept that should be basic in Python. 
If we really want to, we can just link to Python’s documentation on dict 
interface.



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