subhramit commented on code in PR #71976:
URL: https://github.com/apache/airflow/pull/71976#discussion_r3889487242


##########
providers/influxdb/src/airflow/providers/influxdb/hooks/influxdb3.py:
##########
@@ -205,6 +222,45 @@ def query(self, query: str) -> pd.DataFrame:
 
         return result
 
+    async def query_async(self, query: str) -> list[dict[str, Any]]:
+        """
+        Run a SQL query from the triggerer and return JSON-serializable 
records.
+
+        ``InfluxDBClient3.query_async`` runs the blocking Arrow Flight calls 
in the event
+        loop's default executor. It is a plain coroutine that resolves once 
the whole result
+        stream has been read -- InfluxDB 3 has no submit-then-poll query API, 
so there is
+        nothing to poll in between. Connection setup and DataFrame conversion 
are offloaded
+        with ``asyncio.to_thread`` so that no step runs on the triggerer's 
event loop.
+
+        :param query: SQL query string
+        :return: List of dictionaries representing query results
+        """
+        client = await asyncio.to_thread(self.get_conn)

Review Comment:
   Was unaware of this, thanks. Changed to that async-hook pattern



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