( # pylint: disable=too-many-positional-arguments
data: DataType,
enable_categorical: bool,
missing: FloatCompatible,
n_threads: int,
feature_names: Optional[FeatureNames],
feature_types: Optional[Union[FeatureTypes, Categories]],
data_split_mode: DataSplitMode = DataSplitMode.ROW,
)
| 856 | |
| 857 | |
| 858 | def _from_arrow_table( # pylint: disable=too-many-positional-arguments |
| 859 | data: DataType, |
| 860 | enable_categorical: bool, |
| 861 | missing: FloatCompatible, |
| 862 | n_threads: int, |
| 863 | feature_names: Optional[FeatureNames], |
| 864 | feature_types: Optional[Union[FeatureTypes, Categories]], |
| 865 | data_split_mode: DataSplitMode = DataSplitMode.ROW, |
| 866 | ) -> DispatchedDataBackendReturnType: |
| 867 | df_t, feature_names, feature_types = _transform_arrow_table( |
| 868 | data, enable_categorical, feature_names, feature_types |
| 869 | ) |
| 870 | handle = ctypes.c_void_p() |
| 871 | _check_call( |
| 872 | _LIB.XGDMatrixCreateFromColumnar( |
| 873 | df_t.array_interface(), |
| 874 | make_jcargs( |
| 875 | nthread=n_threads, missing=missing, data_split_mode=data_split_mode |
| 876 | ), |
| 877 | ctypes.byref(handle), |
| 878 | ) |
| 879 | ) |
| 880 | return handle, feature_names, feature_types |
| 881 | |
| 882 | |
| 883 | @functools.cache |
no test coverage detected