| 2105 | self.store.close() |
| 2106 | |
| 2107 | def get_result(self, coordinates: bool = False): |
| 2108 | # return the actual iterator |
| 2109 | if self.chunksize is not None: |
| 2110 | if not isinstance(self.s, Table): |
| 2111 | raise TypeError("can only use an iterator or chunksize on a table") |
| 2112 | |
| 2113 | self.coordinates = self.s.read_coordinates(where=self.where) |
| 2114 | |
| 2115 | return self |
| 2116 | |
| 2117 | # if specified read via coordinates (necessary for multiple selections |
| 2118 | if coordinates: |
| 2119 | if not isinstance(self.s, Table): |
| 2120 | raise TypeError("can only read_coordinates on a table") |
| 2121 | where = self.s.read_coordinates( |
| 2122 | where=self.where, start=self.start, stop=self.stop |
| 2123 | ) |
| 2124 | else: |
| 2125 | where = self.where |
| 2126 | |
| 2127 | # directly return the result |
| 2128 | results = self.func(self.start, self.stop, where) |
| 2129 | self.close() |
| 2130 | return results |
| 2131 | |
| 2132 | |
| 2133 | class IndexCol: |