amoghrajesh commented on code in PR #68319:
URL: https://github.com/apache/airflow/pull/68319#discussion_r3387017371
##########
airflow-core/docs/authoring-and-scheduling/language-sdks/go.rst:
##########
@@ -252,6 +252,35 @@ Go types.
Not-found lookups return sentinel errors - ``VariableNotFound``,
``ConnectionNotFound``, ``XComNotFound`` -
so you can branch on a missing value with ``errors.Is`` rather than parsing an
error string.
+.. _go-sdk/runtime-context:
+
+Reading the task runtime context
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Call ``sdk.CurrentContext(ctx)`` inside a task to read the identifiers and
scheduling timestamps of the
+running task instance and its Dag run -- the Go equivalent of the execution
context the Python and Java SDKs
+expose:
+
+.. code-block:: go
+
+ func extract(ctx context.Context, log *slog.Logger) (any, error) {
+ rc := sdk.CurrentContext(ctx)
Review Comment:
Can't we call it runContext? Python sdk calls it `TIRunContext` iirc
--
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]