Skip to content

Commit

Permalink
use generator typehint
Browse files Browse the repository at this point in the history
  • Loading branch information
ion-elgreco committed Nov 12, 2023
1 parent 2337bd7 commit 850a05a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/deltalake/schema.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING, Union
from typing import TYPE_CHECKING, Generator, Union

import pyarrow as pa
import pyarrow.dataset as ds
Expand Down Expand Up @@ -82,7 +82,7 @@ def struct_to_delta_dtype(dtype: pa.StructType) -> pa.StructType:

def _cast_schema_to_recordbatchreader(
reader: pa.RecordBatchReader, schema: pa.schema
) -> pa.RecordBatch:
) -> Generator[pa.RecordBatch, None, None]:
"""Creates recordbatch generator."""
for batch in reader:
yield pa.Table.from_batches([batch]).cast(schema).to_batches()[0]
Expand Down

0 comments on commit 850a05a

Please sign in to comment.