dstandish commented on code in PR #63568:
URL: https://github.com/apache/airflow/pull/63568#discussion_r3269066422


##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -142,6 +145,38 @@
 tracer = trace.get_tracer(__name__)
 
 
+class detail_span:
+    """Context manager and decorator that creates a child span when detail 
level > 1."""
+
+    def __init__(self, *args, **kwargs):
+        self._args = args
+        self._kwargs = kwargs
+        self._ctx = None
+
+    def _make_ctx(self):
+        parent_span = trace.get_current_span()
+        config_level = get_task_span_detail_level(span=parent_span)
+        if config_level > 1:
+            return tracer.start_as_current_span(*self._args, **self._kwargs)
+        return trace.INVALID_SPAN
+
+    def __enter__(self):
+        self._ctx = self._make_ctx()
+        return self._ctx.__enter__()

Review Comment:
   not true



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