| 1947 | |
| 1948 | @_generative |
| 1949 | def yield_per(self, num: int) -> Self: |
| 1950 | # TODO: this throws away the iterator which may be holding |
| 1951 | # onto a chunk. the yield_per cannot be changed once any |
| 1952 | # rows have been fetched. either find a way to enforce this, |
| 1953 | # or we can't use itertools.chain and will instead have to |
| 1954 | # keep track. |
| 1955 | |
| 1956 | self._yield_per = num |
| 1957 | self.iterator = itertools.chain.from_iterable(self.chunks(num)) |
| 1958 | return self |
| 1959 | |
| 1960 | def _soft_close(self, hard: bool = False, **kw: Any) -> None: |
| 1961 | super()._soft_close(hard=hard, **kw) |