[pyspark] Don't stack for non feature columns (#9088)

This commit is contained in:
Bobby Wang 2023-04-25 23:09:12 +08:00 committed by GitHub
parent a2cc78c1fb
commit 17add4776f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,7 +219,9 @@ def create_dmatrix_from_partitions( # pylint: disable=too-many-arguments
array: Optional[np.ndarray] = part[feature_cols] array: Optional[np.ndarray] = part[feature_cols]
elif part[name].shape[0] > 0: elif part[name].shape[0] > 0:
array = part[name] array = part[name]
array = stack_series(array) if name == alias.data:
# For the array/vector typed case.
array = stack_series(array)
else: else:
array = None array = None