| 623 | |
| 624 | protected: |
| 625 | Status Validate() const { |
| 626 | if (list_count_ > 0) { |
| 627 | if (list_count_ + none_count_ != total_count_) { |
| 628 | return Status::Invalid("cannot mix list and non-list, non-null values"); |
| 629 | } |
| 630 | RETURN_NOT_OK(list_inferrer_->Validate()); |
| 631 | } else if (struct_count_ > 0) { |
| 632 | if (struct_count_ + none_count_ != total_count_) { |
| 633 | return Status::Invalid("cannot mix struct and non-struct, non-null values"); |
| 634 | } |
| 635 | for (const auto& it : struct_inferrers_) { |
| 636 | RETURN_NOT_OK(it.second.Validate()); |
| 637 | } |
| 638 | } |
| 639 | return Status::OK(); |
| 640 | } |
| 641 | |
| 642 | Status VisitArrowScalar(PyObject* obj, bool* keep_going /* unused */) { |
| 643 | ARROW_ASSIGN_OR_RAISE(auto scalar, arrow::py::unwrap_scalar(obj)); |