We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 621337c commit b50c630Copy full SHA for b50c630
1 file changed
ontograph/utils.py
@@ -63,9 +63,14 @@ def _create_reverse_mapping(
63
Returns:
64
A dictionary where keys are IDs from source columns and values are from the target_column.
65
"""
66
- if dataframe.empty or target_column not in dataframe.columns:
+ if dataframe.empty:
67
return set(), {}
68
69
+ if target_column not in dataframe.columns:
70
+ raise KeyError(
71
+ f"Target column '{target_column}' not found in DataFrame."
72
+ )
73
+
74
# Ensure we only work with rows that have a target ID
75
df_filtered = dataframe.dropna(subset=[target_column])
76
0 commit comments