| 796 | |
| 797 | |
| 798 | void AsyncAddArrowTextColumn( |
| 799 | ui32 flatFeatureIdx, |
| 800 | PyObject* capsule, |
| 801 | IRawFeaturesOrderDataVisitor* builderVisitor, |
| 802 | TVector<std::future<void>>* result |
| 803 | ) { |
| 804 | auto callback = [=] (TArrowSchemaHolderPtr schema, TArrowArrayHolderPtr array) { |
| 805 | auto process = [=] () { |
| 806 | try { |
| 807 | CB_ENSURE( |
| 808 | array->Data.null_count <= 0, |
| 809 | "Data with nulls is not supported for text columns" |
| 810 | ); |
| 811 | |
| 812 | TVector<TString> result(array->Data.length); |
| 813 | |
| 814 | ProcessNonNullableStringColumn( |
| 815 | schema, |
| 816 | array, |
| 817 | "text", |
| 818 | [&, flatFeatureIdx](size_t dstObjIdx, TStringBuf value) { |
| 819 | result[dstObjIdx] = TString(value); |
| 820 | } |
| 821 | ); |
| 822 | |
| 823 | builderVisitor->AddTextFeature(flatFeatureIdx, result); |
| 824 | } catch (...) { |
| 825 | ythrow TCatBoostException() << "Error while processing column '" << schema->Data.name << "': " |
| 826 | << CurrentExceptionMessage(); |
| 827 | } |
| 828 | }; |
| 829 | |
| 830 | result->push_back(std::async(std::move(process))); |
| 831 | }; |
| 832 | |
| 833 | ProcessArrowArrayStream( |
| 834 | capsule, |
| 835 | std::move(callback) |
| 836 | ); |
| 837 | } |
| 838 | |
| 839 | } |
nothing calls this directly
no test coverage detected