Skip to content

Commit

Permalink
0.0.177
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Dec 30, 2024
1 parent af4809a commit 371a6a4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 13 additions & 6 deletions orso/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,29 @@ def __iter__(self):

def __next__(self):
if self.rows_processed >= self.max_size:
raise StopIteration
raise StopIteration()

try:
row = next(self.current_rows)
row = next(self.current_rows, None)
if row is not None:
self.rows_processed += 1
return row
except StopIteration:
else:
# Fetch the next table and process it
self.current_table = next(self.tables, None)
if self.current_table is None:
raise StopIteration
raise StopIteration()

self.current_rows = iter(
process_table(self.current_table, self.row_factory, self.batch_size)
)
return self.__next__()

# Check if the new table has rows to process
row = next(self.current_rows, None)
if row is not None:
self.rows_processed += 1
return row
else:
raise StopIteration()


def to_arrow(dataset, size=None):
Expand Down
2 changes: 1 addition & 1 deletion orso/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__: str = "0.0.176"
__version__: str = "0.0.177"
__author__: str = "@joocer"

0 comments on commit 371a6a4

Please sign in to comment.