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


##########
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.
+
+For a complete list of available context variables see :ref:`Templates 
reference <templates:variables>` and the :class:`airflow.utils.context.Context` 
type definition on `GitHub 
<https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/utils/context.py>`_.
+
 .. code-block:: python
 
-    def build_complex_command(context, jinja_env):
+    from typing import TYPE_CHECKING
+
+    if TYPE_CHECKING:
+        import jinja2
+        from airflow.utils.context import Context

Review Comment:
   My understanding was that airflow.utils.context represents internal context 
related utilities and airflow.sdk provides stable interface for interacting 
with Airflow's context. 
   ```from airflow.sdk.definitions.context import Context``` - this is a 
re-export in airflow.utils.context, so I used the Modifying to airflow.sdk; I 
do see this references in latest code examples.



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