uranusjr commented on code in PR #70805:
URL: https://github.com/apache/airflow/pull/70805#discussion_r3732418391
##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -1012,21 +1013,34 @@ def _register_deserialization_allowed_classes(dag, log:
Logger) -> None:
)
-@detail_span("parse")
-def parse(what: StartupDetails, log: Logger) -> RuntimeTaskInstance:
- # TODO: Task-SDK:
- # Using BundleDagBag here is about 98% wrong, but it'll do for now
- from airflow.dag_processing.dagbag import BundleDagBag
+def initialize_ti_bundle(bundle_info: BundleInfo, log: Logger) ->
BaseDagBundle:
Review Comment:
The supervisor now imports task_runner (OTel, pydantic, the operator tree)
on every language-SDK task start to get five lines of bundle resolution, and
the lazy import at only defers that cost rather than removing it.
Could this and `_verify_bundle_access` move to a new module? They only
depend on DagBundlesManager and AirflowException, so _subprocess.py could
import it at module level and drop the lazy-import comment.
--
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]