| 133 | } |
| 134 | |
| 135 | pub fn collect_arrow<'py>( |
| 136 | &'py self, |
| 137 | query: Query, |
| 138 | config: StreamConfig, |
| 139 | py: Python<'py>, |
| 140 | ) -> PyResult<Bound<'py, PyAny>> { |
| 141 | let inner = Arc::clone(&self.inner); |
| 142 | |
| 143 | future_into_py(py, async move { |
| 144 | let query = query.try_convert().context("parse query")?; |
| 145 | let config = config.try_convert().context("parse config")?; |
| 146 | |
| 147 | let res = inner |
| 148 | .collect_arrow(query, config) |
| 149 | .await |
| 150 | .context("collect arrow")?; |
| 151 | |
| 152 | let res = response_to_pyarrow(res).context("convert response to pyarrow")?; |
| 153 | |
| 154 | Ok(res) |
| 155 | }) |
| 156 | } |
| 157 | |
| 158 | pub fn collect_parquet<'py>( |
| 159 | &'py self, |