| 324 | } |
| 325 | |
| 326 | Result<std::shared_ptr<Tensor>> Array::ToTensor(bool allow_nulls) const { |
| 327 | if (!allow_nulls && null_count() > 0) { |
| 328 | return Status::Invalid( |
| 329 | "Array contains nulls, explicitly pass `allow_nulls=true` to leave them " |
| 330 | "undefined."); |
| 331 | } |
| 332 | |
| 333 | return ToTensorWithNulls(); |
| 334 | } |
| 335 | |
| 336 | Result<std::shared_ptr<Tensor>> Array::ToTensorWithNulls() const { |
| 337 | return Status::TypeError("ToTensor is not implemented for Array type ", type()->name()); |