@@ -1040,9 +1040,12 @@ def execute_stream_partitioned(self) -> list[RecordBatchStream]:
10401040 streams = self .df .execute_stream_partitioned ()
10411041 return [RecordBatchStream (rbs ) for rbs in streams ]
10421042
1043- def to_record_batch_stream (self ) -> RecordBatchStream : # noqa: F811
1043+ @deprecated ("Use execute_stream() instead" )
1044+ def to_record_batch_stream (self ) -> RecordBatchStream :
10441045 """Return a :py:class:`RecordBatchStream` over this DataFrame's results.
10451046
1047+ This method is deprecated. Use :py:meth:`execute_stream` instead.
1048+
10461049 Returns:
10471050 A ``RecordBatchStream`` representing the lazily generated record
10481051 batches for this DataFrame.
@@ -1133,11 +1136,11 @@ def __arrow_c_stream__(self, requested_schema: object | None = None) -> object:
11331136
11341137 def __iter__ (self ) -> Iterator [RecordBatch ]:
11351138 """Return an iterator over this DataFrame's record batches."""
1136- return iter (self .to_record_batch_stream ())
1139+ return iter (self .execute_stream ())
11371140
11381141 def __aiter__ (self ) -> AsyncIterator [RecordBatch ]:
11391142 """Return an async iterator over this DataFrame's record batches."""
1140- return self .to_record_batch_stream ().__aiter__ ()
1143+ return self .execute_stream ().__aiter__ ()
11411144
11421145 def transform (self , func : Callable [..., DataFrame ], * args : Any ) -> DataFrame :
11431146 """Apply a function to the current DataFrame which returns another DataFrame.
0 commit comments