@@ -61,7 +61,7 @@ static void InitializeConsumers(py::class_<DuckDBPyRelation> &m) {
61
61
py::arg (" date_as_object" ) = false )
62
62
.def (" fetch_df_chunk" , &DuckDBPyRelation::FetchDFChunk, " Execute and fetch a chunk of the rows" ,
63
63
py::arg (" vectors_per_chunk" ) = 1 , py::kw_only (), py::arg (" date_as_object" ) = false )
64
- .def (" arrow" , &DuckDBPyRelation::ToArrowTable , " Execute and fetch all rows as an Arrow Table " ,
64
+ .def (" arrow" , &DuckDBPyRelation::ToRecordBatch , " Execute and return an Arrow Record Batch Reader that yields all rows " ,
65
65
py::arg (" batch_size" ) = 1000000 )
66
66
.def (" fetch_arrow_table" , &DuckDBPyRelation::ToArrowTable, " Execute and fetch all rows as an Arrow Table" ,
67
67
py::arg (" batch_size" ) = 1000000 )
@@ -78,10 +78,18 @@ static void InitializeConsumers(py::class_<DuckDBPyRelation> &m) {
78
78
)" ;
79
79
m.def (" __arrow_c_stream__" , &DuckDBPyRelation::ToArrowCapsule, capsule_docs,
80
80
py::arg (" requested_schema" ) = py::none ());
81
- m.def (" record_batch" , &DuckDBPyRelation::ToRecordBatch,
82
- " Execute and return an Arrow Record Batch Reader that yields all rows" , py::arg (" batch_size" ) = 1000000 )
83
- .def (" fetch_arrow_reader" , &DuckDBPyRelation::ToRecordBatch,
84
- " Execute and return an Arrow Record Batch Reader that yields all rows" , py::arg (" batch_size" ) = 1000000 );
81
+ m.def (" fetch_record_batch" , &DuckDBPyRelation::ToRecordBatch,
82
+ " Execute and return an Arrow Record Batch Reader that yields all rows" , py::arg (" rows_per_batch" ) = 1000000 )
83
+ .def (" fetch_arrow_reader" , &DuckDBPyRelation::ToRecordBatch,
84
+ " Execute and return an Arrow Record Batch Reader that yields all rows" , py::arg (" batch_size" ) = 1000000 )
85
+ .def (" record_batch" ,
86
+ [](pybind11::object &self, idx_t rows_per_batch)
87
+ {
88
+ PyErr_WarnEx (PyExc_DeprecationWarning,
89
+ " record_batch() is deprecated, use fetch_record_batch() instead." ,
90
+ 0 );
91
+ return self.attr (" fetch_record_batch" )(rows_per_batch);
92
+ }, py::arg (" batch_size" ) = 1000000 );
85
93
}
86
94
87
95
static void InitializeAggregates (py::class_<DuckDBPyRelation> &m) {
0 commit comments