JH-A-Kim commented on code in PR #68106:
URL: https://github.com/apache/airflow/pull/68106#discussion_r3384471693


##########
airflow-core/src/airflow/jobs/triggerer_job_runner.py:
##########
@@ -495,37 +478,38 @@ def start(  # type: ignore[override]
         **kwargs,
     ):
         proc_id = job.id if job is not None else uuid4()
-        proc = super().start(id=proc_id, job=job, target=cls.run_in_process, 
logger=logger, **kwargs)
 
-        msg = messages.StartTriggerer()
-        proc.send_msg(msg, request_id=0)
+        from airflow.sdk.api.client import Client
+        api = in_process_api_server()
+        client = Client(base_url=None, token="", dry_run=True, 
transport=api.transport)
+        client.base_url = "http://in-process.invalid./";
+
+        proc = super().start(id=proc_id, job=job, 
client=client,target=cls.run_in_process, logger=logger, **kwargs)
+        proc.send_msg(messages.StartTriggerer(), request_id=0)
         return proc
 
-    @functools.cached_property
-    def client(self) -> Client:
-        return self.make_client()
+    # @functools.cached_property
+    # def client(self) -> Client:
+    #     return self.make_client()
 
-    def make_client(self) -> Client:
-        """
-        Build the API client used to talk to the API server.
+    # def make_client(self) -> Client:
+    #     """
+    #     Build the API client used to talk to the API server.
 
-        Subclasses may override this to substitute a different transport — 
e.g. a
-        real HTTP client pointing at a remote API server — instead of the 
default
-        in-process one. The returned client must have ``base_url`` set; 
downstream
-        request handling (``self.client.variables``, ``.xcoms``, etc.) reads it
-        when issuing requests.
-        """
-        from airflow.sdk.api.client import Client
+    #     Subclasses may override this to substitute a different transport — 
e.g. a
+    #     real HTTP client pointing at a remote API server — instead of the 
default
+    #     in-process one. The returned client must have ``base_url`` set; 
downstream
+    #     request handling (``self.client.variables``, ``.xcoms``, etc.) reads 
it
+    #     when issuing requests.
+    #     """
+    #     from airflow.sdk.api.client import Client
 
-        client = Client(base_url=None, token="", dry_run=True, 
transport=in_process_api_server().transport)
-        # Mypy is wrong -- the setter accepts a string on the property setter! 
`URLType = URL | str`
-        client.base_url = "http://in-process.invalid./";
-        return client
+    #     client = Client(base_url=None, token="", dry_run=True, 
transport=in_process_api_server().transport)
+    #     # Mypy is wrong -- the setter accepts a string on the property 
setter! `URLType = URL | str`
+    #     client.base_url = "http://in-process.invalid./";
+    #     return client

Review Comment:
   Im on it 🫡 



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