SameerMesiah97 commented on code in PR #66658:
URL: https://github.com/apache/airflow/pull/66658#discussion_r3221604474
##########
providers/elasticsearch/src/airflow/providers/elasticsearch/hooks/elasticsearch.py:
##########
@@ -99,7 +106,29 @@ def fetchone(self):
return None
def fetchmany(self, size: int | None = None):
- raise NotImplementedError()
+ size = size or self.body["fetch_size"]
+
+ results: list[list[Any]] = []
+
+ while len(results) < size:
+ # Consume rows from the current page buffer before
+ # requesting additional cursor pages from Elasticsearch.
+ if self._rows:
+ remaining = size - len(results)
+
+ results.extend(self._rows[:remaining])
+
+ self._rows = self._rows[remaining:]
Review Comment:
`collections.deque` is now being used.
--
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]