Skip to content

Commit f08114c

Browse files
trivialfisCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent f2ce907 commit f08114c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

python-package/xgboost/data.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,11 @@ def _transform_pandas_df(
658658
if meta and len(data.columns) > 1 and meta not in _matrix_meta:
659659
raise ValueError(f"DataFrame for {meta} cannot have multiple columns")
660660
if data.columns.has_duplicates:
661-
raise ValueError("Duplicate column names are not supported.")
661+
duplicates = data.columns[data.columns.duplicated()].unique().tolist()
662+
raise ValueError(
663+
"Duplicate column names are not supported. "
664+
f"Duplicates found: {duplicates}"
665+
)
662666

663667
feature_types, ref_categories = get_ref_categories(feature_types)
664668
feature_names, feature_types = pandas_feature_info(

0 commit comments

Comments
 (0)